-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix shell inference in powershell when installed through scoop (#1164)
* be more verbose on shell inference issues in Windows * add changeset * fix shell inference with scoop * change changeset text * test scoop shims * don't concat paths * skip instead of not emitting tests * setup scoop in windows * use test.skip
- Loading branch information
Showing
5 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"fnm": patch | ||
--- | ||
|
||
windows: fix shell inference in powershell when using scoop's shims |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { script } from "./shellcode/script.js" | ||
import { Bash, Fish, PowerShell, WinCmd, Zsh } from "./shellcode/shells.js" | ||
import testNodeVersion from "./shellcode/test-node-version.js" | ||
import describe from "./describe.js" | ||
import os from "node:os" | ||
import { execa } from "execa" | ||
|
||
if (os.platform() !== "win32") { | ||
test.skip("scoop shims only work on Windows", () => {}) | ||
} else { | ||
beforeAll(async () => { | ||
// Create a scoop shim for tests | ||
await execa(`scoop`, [ | ||
"shim", | ||
"add", | ||
"fnm_release", | ||
"target/release/fnm.exe", | ||
]) | ||
}) | ||
|
||
for (const shell of [Bash, Zsh, Fish, PowerShell, WinCmd]) { | ||
describe(shell, () => { | ||
test(`scoop shims infer the shell`, async () => { | ||
await script(shell) | ||
.then(shell.env({ executableName: "fnm_release" })) | ||
.then(shell.call("fnm_release", ["install", "v20.14.0"])) | ||
.then(shell.call("fnm_release", ["use", "v20.14.0"])) | ||
.then(testNodeVersion(shell, "v20.14.0")) | ||
.execute(shell) | ||
}) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters