Skip to content

Commit 2c22844

Browse files
authored
fix: Work with global config.
1 parent 94d6d8e commit 2c22844

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/extension.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ class BashConfigurationProvider implements vscode.DebugConfigurationProvider {
4949
return undefined;
5050
}
5151

52-
if (!folder) {
53-
let msg = "Unable to determine workspace folder.";
54-
return vscode.window.showErrorMessage(msg).then(_ => { return undefined; });
55-
}
56-
5752
// Else launch.json exists
5853
if (!config.type || !config.name) {
5954
let msg = "BUG in Bash Debug: reached to unreachable code.";
@@ -88,7 +83,13 @@ class BashConfigurationProvider implements vscode.DebugConfigurationProvider {
8883
// Fill non-"required" attributes with default values to prevent bashdb (or other programs) from panic
8984
if (!config.args) { config.args = []; }
9085
if (!config.env) { config.env = {}; }
91-
if (!config.cwd) { config.cwd = folder.uri.fsPath; }
86+
if (!config.cwd) {
87+
if (!folder) {
88+
let msg = "Unable to determine workspace folder.";
89+
return vscode.window.showErrorMessage(msg).then(_ => { return undefined; });
90+
}
91+
config.cwd = folder.uri.fsPath;
92+
}
9293
if (!config.pathBash) {
9394
config.pathBash = "bash";
9495
}
@@ -113,7 +114,7 @@ class BashConfigurationProvider implements vscode.DebugConfigurationProvider {
113114
if (!config.pathMkfifo) { config.pathMkfifo = "mkfifo"; }
114115
if (!config.pathPkill) {
115116

116-
if ( process.platform === "darwin" ) {
117+
if (process.platform === "darwin") {
117118
const pathPkill = which(__dirname).sync('pkill');
118119
if (pathPkill === "/usr/local/bin/pkill") {
119120
vscode.window.showInformationMessage(`Using /usr/bin/pkill instead of /usr/local/bin/pkill`);

0 commit comments

Comments
 (0)