Skip to content

Commit

Permalink
Filter for only directories in sync destination quickpick (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikgupta-db authored Mar 21, 2023
1 parent c493446 commit 952879b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
for i, arg in enumerate(sys.argv):
if i == 0:
continue
if sys.argv[i-1] == "--databricks-python-source":
if sys.argv[i-1] == "--databricks-source-file":
python_file = arg
elif sys.argv[i-1] == "--databricks-project-root":
project_root = arg
Expand Down
24 changes: 16 additions & 8 deletions packages/databricks-vscode/src/configuration/ConnectionCommands.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import {Cluster, WorkspaceFsEntity} from "@databricks/databricks-sdk";
import {
Cluster,
WorkspaceFsEntity,
WorkspaceFsUtils,
} from "@databricks/databricks-sdk";
import {homedir} from "node:os";
import {
Disposable,
Expand Down Expand Up @@ -241,13 +245,17 @@ export class ConnectionCommands implements Disposable {
input.items = children;
if (workspaceConfigs.enableFilesInWorkspace) {
children.push(
...((await rootDir?.children) ?? []).map((entity) => {
return {
label: entity.basename,
detail: entity.path,
path: entity.path,
};
})
...((await rootDir?.children) ?? [])
.filter((entity) =>
WorkspaceFsUtils.isDirectory(entity)
)
.map((entity) => {
return {
label: entity.basename,
detail: entity.path,
path: entity.path,
};
})
);
} else {
const repos = (await rootDir?.children) ?? [];
Expand Down

0 comments on commit 952879b

Please sign in to comment.