Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/server/src/diagnostics/ProcessDiagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ const runProcess = Effect.fn("runProcess")(
const child = yield* spawner.spawn(
ChildProcess.make(input.command, input.args, {
cwd: process.cwd(),
shell: process.platform === "win32",
}),
);
const [stdout, stderr, exitCode] = yield* Effect.all(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const runFriendlyLabelCommand = Effect.fn("runFriendlyLabelCommand")(function* (
command,
args,
timeoutBehavior: "timedOutResult",
shell: process.platform === "win32",
})
.pipe(Effect.option);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const git = (cwd: string, args: ReadonlyArray<string>) =>
return yield* processRunner.run({
command: "git",
args: ["-C", cwd, ...args],
shell: process.platform === "win32",
});
}).pipe(Effect.provide(ProcessRunner.layer));

Expand Down
2 changes: 0 additions & 2 deletions apps/server/src/project/Layers/RepositoryIdentityResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ const resolveRepositoryIdentityCacheKey = Effect.fn("resolveRepositoryIdentityCa
command: "git",
args: ["-C", cwd, "rev-parse", "--show-toplevel"],
timeoutBehavior: "timedOutResult",
shell: process.platform === "win32",
})
.pipe(Effect.option);
if (topLevelResult._tag === "None" || topLevelResult.value.code !== 0) {
Expand All @@ -119,7 +118,6 @@ const resolveRepositoryIdentityFromCacheKey = Effect.fn("resolveRepositoryIdenti
command: "git",
args: ["-C", cacheKey, "remote", "-v"],
timeoutBehavior: "timedOutResult",
shell: process.platform === "win32",
})
.pipe(Effect.option);
if (remoteResult._tag === "None" || remoteResult.value.code !== 0) {
Expand Down
1 change: 0 additions & 1 deletion apps/server/src/terminal/Layers/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ function windowsInspectSubprocess(
timeout: "1500 millis",
maxOutputBytes: 32_768,
outputMode: "truncate",
shell: process.platform === "win32",
timeoutBehavior: "timedOutResult",
});
}).pipe(
Expand Down
8 changes: 4 additions & 4 deletions packages/ssh/src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { SshCommandError, SshInvalidTargetError } from "./errors.ts";
const PUBLISHABLE_T3_VERSION_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u;
const DEFAULT_SSH_COMMAND_TIMEOUT_MS = 60_000;
const MAX_SSH_ERROR_OUTPUT_LENGTH = 4_000;
export const SSH_COMMAND = process.platform === "win32" ? "ssh.exe" : "ssh";

const encoder = new TextEncoder();

Expand Down Expand Up @@ -192,15 +193,14 @@ const runSshCommandInScope = Effect.fn("ssh/command.runSshCommand.inScope")(func
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
yield* Effect.logDebug("ssh.command.start", {
...sshTargetLogFields(target),
command: ["ssh", ...args],
command: [SSH_COMMAND, ...args],
hasStdin: input.stdin !== undefined,
timeoutMs: input.timeoutMs ?? DEFAULT_SSH_COMMAND_TIMEOUT_MS,
});
const child = yield* spawner
.spawn(
ChildProcess.make("ssh", args, {
ChildProcess.make(SSH_COMMAND, args, {
env: environment,
shell: process.platform === "win32",
stdin: {
stream: stdinStream(input.stdin),
endOnDone: true,
Expand All @@ -212,7 +212,7 @@ const runSshCommandInScope = Effect.fn("ssh/command.runSshCommand.inScope")(func
Effect.mapError(
(cause) =>
new SshCommandError({
command: ["ssh", ...args],
command: [SSH_COMMAND, ...args],
exitCode: null,
stderr: "",
message:
Expand Down
6 changes: 3 additions & 3 deletions packages/ssh/src/tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
remoteStateKey,
resolveSshTarget,
runSshCommand,
SSH_COMMAND,
targetConnectionKey,
} from "./command.ts";
import {
Expand Down Expand Up @@ -1068,7 +1069,7 @@ const startSshTunnel = Effect.fn("ssh/tunnel.startSshTunnel")(function* (input:
`${input.localPort}:127.0.0.1:${input.remotePort}`,
hostSpec,
];
const tunnelCommand = ["ssh", ...args];
const tunnelCommand = [SSH_COMMAND, ...args];
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const scope = yield* Scope.Scope;
yield* Effect.logDebug("ssh.tunnel.spawn.start", {
Expand All @@ -1081,9 +1082,8 @@ const startSshTunnel = Effect.fn("ssh/tunnel.startSshTunnel")(function* (input:
});
const child = yield* spawner
.spawn(
ChildProcess.make("ssh", args, {
ChildProcess.make(SSH_COMMAND, args, {
env: childEnvironment,
shell: process.platform === "win32",
stdin: {
stream: Stream.empty,
endOnDone: true,
Expand Down
13 changes: 3 additions & 10 deletions packages/tailscale/src/tailscale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const DEFAULT_TAILSCALE_SERVE_PORT = 443;
export const TAILSCALE_STATUS_TIMEOUT_MS = 1_500;
export const TAILSCALE_SERVE_TIMEOUT_MS = 10_000;
export const TAILSCALE_PROBE_TIMEOUT_MS = 2_500;
const TAILSCALE_COMMAND = process.platform === "win32" ? "tailscale.exe" : "tailscale";

export class TailscaleCommandError extends Data.TaggedError("TailscaleCommandError")<{
readonly command: readonly string[];
Expand Down Expand Up @@ -136,11 +137,7 @@ export const readTailscaleStatus: Effect.Effect<
const args = ["status", "--json"];
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const child = yield* spawner
.spawn(
ChildProcess.make("tailscale", args, {
shell: process.platform === "win32",
}),
)
.spawn(ChildProcess.make(TAILSCALE_COMMAND, args))
.pipe(
Effect.mapError((cause) =>
tailscaleCommandError(
Expand Down Expand Up @@ -215,11 +212,7 @@ const runTailscaleCommand = (
Effect.gen(function* () {
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const child = yield* spawner
.spawn(
ChildProcess.make("tailscale", args, {
shell: process.platform === "win32",
}),
)
.spawn(ChildProcess.make(TAILSCALE_COMMAND, args))
.pipe(
Effect.mapError((cause) =>
tailscaleCommandError(
Expand Down
Loading