Skip to content

Commit f15719b

Browse files
committed
fix: nu shell profile path
1 parent 6b37b48 commit f15719b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/features/terminal/startup/nuShellStartup.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ async function isNuShellInstalled(): Promise<boolean> {
2424

2525
async function getDefaultConfigPath(): Promise<string | undefined> {
2626
try {
27-
const configPath = await runCommand('nu -c $nu.default-config-dir');
27+
const configPath = await runCommand(
28+
isWindows() ? 'nu -c $nu.default-config-dir' : 'nu -c \\$nu.default-config-dir',
29+
);
2830

2931
return configPath ? configPath.trim() : undefined;
3032
} catch (err) {
@@ -36,9 +38,10 @@ async function getDefaultConfigPath(): Promise<string | undefined> {
3638
async function getNuShellProfile(): Promise<string> {
3739
const pathsToCheck: string[] = [];
3840

39-
const defaultConfigPath = await getDefaultConfigPath();
41+
let defaultConfigPath = await getDefaultConfigPath();
4042
if (defaultConfigPath) {
41-
pathsToCheck.push(path.join(defaultConfigPath, 'config.nu'));
43+
defaultConfigPath = path.join(defaultConfigPath, 'config.nu');
44+
return defaultConfigPath;
4245
}
4346

4447
if (isWindows()) {

0 commit comments

Comments
 (0)