Skip to content

Commit d4c8286

Browse files
committed
Notification fixup and handling source and path in shellsetting
1 parent d914801 commit d4c8286

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/services/actions/Dependencies.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class Dependencies {
7474

7575
let canProceedWithDependencyCheck = false;
7676
if (!isValidNode) {
77-
progress.report({ message: 'It looks like your Node.js version is not supported. Let me check what options are available to resolve this...' });
77+
progress.report({ message: 'Node.js version not supported. Checking options...' });
7878
canProceedWithDependencyCheck = await Dependencies.HandleNotValidNodeVersion(spfxVersion.SupportedNodeVersions[spfxVersion.SupportedNodeVersions.length - 1], spfxVersion.SupportedNodeVersions);
7979
}
8080

@@ -167,8 +167,9 @@ export class Dependencies {
167167
const useNvsOption = 'Use NVS';
168168

169169
Notifications.warning(
170-
`Your Node.js version is not supported with SPFx development. Make sure you are using version: v${requiredNodeVersions}.
171-
It is recommended to use a Node Version Manager to handle multiple Node.js versions on your machine and align SPFx Toolkit setting with your preferred Node Version Manager.
170+
`Your Node.js version is not supported for SPFx v${requiredNodeVersions}.
171+
It is recommended to use a Node Version Manager to handle multiple Node.js versions
172+
and set SPFx Toolkit setting with your preferred Node Version Manager.
172173
Please select one of the options below to get help on installing or updating your Node.js version.`,
173174
installNodeJSOption,
174175
useNvmOption,

src/services/executeWrappers/TerminalCommandExecuter.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import { Logger } from '../dataType/Logger';
1212

1313

1414
interface ShellSetting {
15-
source: string;
15+
source?: string;
16+
path?: string;
1617
}
1718

1819
export class TerminalCommandExecuter {
@@ -288,10 +289,10 @@ export class TerminalCommandExecuter {
288289
* If the shell path is undefined, it sets the `shellPath` to undefined.
289290
*/
290291
private static initShellPath() {
291-
const shell: string | { source: string } | undefined = TerminalCommandExecuter.getShellPath();
292+
const shell: string | ShellSetting | undefined = TerminalCommandExecuter.getShellPath();
292293

293294
if (typeof shell !== 'string' && !!shell) {
294-
TerminalCommandExecuter.shellPath = shell.source;
295+
TerminalCommandExecuter.shellPath = shell.path || shell.source;
295296
} else {
296297
TerminalCommandExecuter.shellPath = shell || undefined;
297298
}
@@ -386,9 +387,9 @@ export class TerminalCommandExecuter {
386387
}
387388

388389
private static getCommandChainOperator(): string {
389-
const shell = TerminalCommandExecuter.shell?.toLowerCase() || '';
390+
const shell = TerminalCommandExecuter.shell || '';
390391

391-
if (shell.includes('powershell') || shell.includes('pwsh')) {
392+
if (shell.includes('PowerShell') || shell.includes('pwsh')) {
392393
return ';';
393394
}
394395

0 commit comments

Comments
 (0)