@@ -49,11 +49,6 @@ class BashConfigurationProvider implements vscode.DebugConfigurationProvider {
49
49
return undefined ;
50
50
}
51
51
52
- if ( ! folder ) {
53
- let msg = "Unable to determine workspace folder." ;
54
- return vscode . window . showErrorMessage ( msg ) . then ( _ => { return undefined ; } ) ;
55
- }
56
-
57
52
// Else launch.json exists
58
53
if ( ! config . type || ! config . name ) {
59
54
let msg = "BUG in Bash Debug: reached to unreachable code." ;
@@ -88,7 +83,13 @@ class BashConfigurationProvider implements vscode.DebugConfigurationProvider {
88
83
// Fill non-"required" attributes with default values to prevent bashdb (or other programs) from panic
89
84
if ( ! config . args ) { config . args = [ ] ; }
90
85
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
+ }
92
93
if ( ! config . pathBash ) {
93
94
config . pathBash = "bash" ;
94
95
}
@@ -113,7 +114,7 @@ class BashConfigurationProvider implements vscode.DebugConfigurationProvider {
113
114
if ( ! config . pathMkfifo ) { config . pathMkfifo = "mkfifo" ; }
114
115
if ( ! config . pathPkill ) {
115
116
116
- if ( process . platform === "darwin" ) {
117
+ if ( process . platform === "darwin" ) {
117
118
const pathPkill = which ( __dirname ) . sync ( 'pkill' ) ;
118
119
if ( pathPkill === "/usr/local/bin/pkill" ) {
119
120
vscode . window . showInformationMessage ( `Using /usr/bin/pkill instead of /usr/local/bin/pkill` ) ;
0 commit comments