Skip to content

Commit 7d4f31b

Browse files
committed
Remove folders with .devfile.yaml/devfile.yaml form quickpick list
This PR fixes #2636. Signed-off-by: Denis Golovin [email protected]
1 parent d09d482 commit 7d4f31b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/util/workspace.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,20 @@ export async function selectWorkspaceFolder(): Promise<Uri> {
2323
if (workspace.workspaceFolders && workspace.workspaceFolders.length > 0) {
2424
folder = workspace.workspaceFolders
2525
.filter((value) => {
26-
let odoDevfileEnvFile = true;
26+
let odoDevfile = true;
2727
try {
28-
odoDevfileEnvFile = !fs
29-
.statSync(path.join(value.uri.fsPath, '.odo', 'env', 'env.yaml')).isFile();
28+
odoDevfile = !fs.statSync(path.join(value.uri.fsPath, 'devfile.yaml')).isFile()
3029
} catch (ignore) {
3130
// ignore errors if file does not exist
3231
}
33-
return odoDevfileEnvFile;
32+
let odoDotDevfile = true;
33+
try {
34+
odoDotDevfile = !fs.statSync(path.join(value.uri.fsPath, '.devfile.yaml')).isFile();
35+
} catch (ignore) {
36+
// ignore errors if file does not exist
37+
}
38+
// if there is no devfile.yaml and no .devfile.yaml in the root of workspace folder
39+
return !odoDevfile && !odoDotDevfile;
3440
})
3541
.map((wsFolder) => ({
3642
label: `$(file-directory) ${wsFolder.uri.fsPath}`,

0 commit comments

Comments
 (0)