Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 44d06a7

Browse files
committed
Fix exit code of build subprocess
1 parent 10afff1 commit 44d06a7

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

cli.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ async function main() {
129129
await run(command, VERSION)
130130
}
131131

132-
async function run(name: string, version: string, importMap?: string) {
132+
async function run(command: string, version: string, importMap?: string) {
133133
const cmd: string[] = [
134134
Deno.execPath(),
135135
'run',
@@ -142,21 +142,18 @@ async function run(name: string, version: string, importMap?: string) {
142142
cmd.push('--import-map', importMap)
143143
}
144144
if (Deno.env.get('ALEPH_DEV') && version === VERSION) {
145-
cmd.push(`./commands/${name}.ts`)
145+
cmd.push(`./commands/${command}.ts`)
146146
} else {
147-
cmd.push(`https://deno.land/x/aleph@v${version}/commands/${name}.ts`)
147+
cmd.push(`https://deno.land/x/aleph@v${version}/commands/${command}.ts`)
148148
}
149149
cmd.push(...Deno.args.slice(1))
150150
const p = Deno.run({
151151
cmd,
152152
stdout: 'inherit',
153153
stderr: 'inherit'
154154
})
155-
await p.status()
156-
p.close()
157-
if (name === 'build') {
158-
Deno.exit(0)
159-
}
155+
const { code } = await p.status()
156+
Deno.exit(code)
160157
}
161158

162159
if (import.meta.main) {

0 commit comments

Comments
 (0)