mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
Support PowerShell and resolve workspaces by directory path
This commit is contained in:
36
packages/server/src/utils/string-command-shell.test.ts
Normal file
36
packages/server/src/utils/string-command-shell.test.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { buildStringCommandShellInvocation } from "./string-command-shell.js";
|
||||
|
||||
describe("buildStringCommandShellInvocation", () => {
|
||||
it("uses bash login-command semantics on unix platforms", () => {
|
||||
expect(
|
||||
buildStringCommandShellInvocation({
|
||||
command: 'echo "hello"',
|
||||
platform: "darwin",
|
||||
}),
|
||||
).toEqual({
|
||||
shell: "/bin/bash",
|
||||
args: ["-lc", 'echo "hello"'],
|
||||
});
|
||||
});
|
||||
|
||||
it("uses powershell command semantics on windows", () => {
|
||||
expect(
|
||||
buildStringCommandShellInvocation({
|
||||
command: "Write-Output 'hello'",
|
||||
platform: "win32",
|
||||
}),
|
||||
).toEqual({
|
||||
shell: "powershell",
|
||||
args: [
|
||||
"-NoProfile",
|
||||
"-NonInteractive",
|
||||
"-ExecutionPolicy",
|
||||
"Bypass",
|
||||
"-Command",
|
||||
"Write-Output 'hello'",
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user