Skip to content

Commit 6a720ed

Browse files
committed
works like this as well
1 parent 172405e commit 6a720ed

1 file changed

Lines changed: 3 additions & 24 deletions

File tree

apps/server/scripts/cli.ts

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,6 @@ const runCommand = Effect.fn("runCommand")(function* (command: ChildProcess.Comm
3232
}
3333
});
3434

35-
const resolveLocalTsdownCommand = Effect.fn("resolveLocalTsdownCommand")(function* (
36-
serverDir: string,
37-
) {
38-
const path = yield* Path.Path;
39-
const fs = yield* FileSystem.FileSystem;
40-
const binDir = path.join(serverDir, "node_modules/.bin");
41-
const candidates =
42-
process.platform === "win32" ? ["tsdown.exe", "tsdown.cmd", "tsdown"] : ["tsdown"];
43-
44-
for (const candidate of candidates) {
45-
const commandPath = path.join(binDir, candidate);
46-
if (yield* fs.exists(commandPath)) {
47-
return commandPath;
48-
}
49-
}
50-
51-
return yield* new CliError({
52-
message: `Missing tsdown binary in ${binDir}. Install dependencies and try again.`,
53-
});
54-
});
55-
5635
interface PublishIconBackup {
5736
readonly targetPath: string;
5837
readonly backupPath: string;
@@ -146,15 +125,15 @@ const buildCmd = Command.make(
146125
const fs = yield* FileSystem.FileSystem;
147126
const repoRoot = yield* RepoRoot;
148127
const serverDir = path.join(repoRoot, "apps/server");
149-
const tsdownCommand = yield* resolveLocalTsdownCommand(serverDir);
150128

151129
yield* Effect.log("[cli] Running tsdown...");
152130
yield* runCommand(
153-
ChildProcess.make(tsdownCommand, [], {
131+
ChildProcess.make({
154132
cwd: serverDir,
133+
shell: process.platform === "win32",
155134
stdout: config.verbose ? "inherit" : "ignore",
156135
stderr: "inherit",
157-
}),
136+
})`bun tsdown`,
158137
);
159138

160139
const webDist = path.join(repoRoot, "apps/web/dist");

0 commit comments

Comments
 (0)