@@ -139,13 +139,15 @@ function isTeamsfxTask(task: vscode.Task): boolean {
139139 let commandLine : string | undefined ;
140140 if ( task . execution && < vscode . ShellExecution > task . execution ) {
141141 const execution = < vscode . ShellExecution > task . execution ;
142- if ( execution . command ) {
143- commandLine =
144- execution . commandLine ||
145- `${
146- typeof execution . command === "string" ? execution . command : execution . command . value
147- } ${ ( execution . args || [ ] ) . join ( " " ) } `;
148- }
142+ commandLine =
143+ execution . commandLine ||
144+ `${
145+ execution . command
146+ ? typeof execution . command === "string"
147+ ? execution . command
148+ : execution . command . value
149+ : ""
150+ } ${ ( execution . args || [ ] ) . join ( " " ) } `;
149151 }
150152 if ( commandLine !== undefined ) {
151153 if ( / ( n p m | y a r n ) [ \s ] + ( r u n ) ? [ \s ] * [ ^ : \s ] + : t e a m s f x / i. test ( commandLine ) ) {
@@ -168,15 +170,17 @@ function isLaunchTestToolTask(task: vscode.Task): boolean {
168170 // dev:teamsfx and watch:teamsfx
169171 if ( task . execution && < vscode . ShellExecution > task . execution ) {
170172 const execution = < vscode . ShellExecution > task . execution ;
171- if ( execution . command ) {
172- const commandLine =
173- execution . commandLine ||
174- `${
175- typeof execution . command === "string" ? execution . command : execution . command . value
176- } ${ ( execution . args || [ ] ) . join ( " " ) } `;
177- if ( / ( n p m | y a r n ) [ \s ] + ( r u n ) ? [ \s ] * [ ^ : \s ] + : t e a m s f x : l a u n c h - t e s t t o o l / i. test ( commandLine ) ) {
178- return true ;
179- }
173+ const commandLine =
174+ execution . commandLine ||
175+ `${
176+ execution . command
177+ ? typeof execution . command === "string"
178+ ? execution . command
179+ : execution . command . value
180+ : ""
181+ } ${ ( execution . args || [ ] ) . join ( " " ) } `;
182+ if ( / ( n p m | y a r n ) [ \s ] + ( r u n ) ? [ \s ] * [ ^ : \s ] + : t e a m s f x : l a u n c h - t e s t t o o l / i. test ( commandLine ) ) {
183+ return true ;
180184 }
181185 }
182186 }
0 commit comments