@@ -145,7 +145,7 @@ export interface Shell<
145
145
( opts : Partial < Omit < Options , 'sync' > > ) : Shell < true >
146
146
}
147
147
}
148
- const bound : [ boolean , string, string, Options ] [ ] = [ ]
148
+ const bound : [ string , string , Options ] [ ] = [ ]
149
149
150
150
export const $ : Shell & Options = new Proxy < Shell & Options > (
151
151
function ( pieces : TemplateStringsArray | Partial < Options > , ...args : any ) {
@@ -171,7 +171,7 @@ export const $: Shell & Options = new Proxy<Shell & Options>(
171
171
args
172
172
) as string
173
173
const sync = snapshot [ SYNC ]
174
- bound . push ( [ sync , cmd , from , snapshot ] )
174
+ bound . push ( [ cmd , from , snapshot ] )
175
175
const process = new ProcessPromise ( noop )
176
176
177
177
if ( ! process . isHalted ( ) || sync ) process . run ( )
@@ -235,14 +235,14 @@ export class ProcessPromise extends Promise<ProcessOutput> {
235
235
executor ?.( ...args )
236
236
} )
237
237
238
- if ( executor === noop ) {
239
- const [ sync , cmd , from , snapshot ] = bound . pop ( ) !
238
+ if ( bound . length ) {
239
+ const [ cmd , from , snapshot ] = bound . pop ( ) !
240
240
this . _command = cmd
241
241
this . _from = from
242
242
this . _resolve = resolve !
243
243
this . _reject = ( v : ProcessOutput ) => {
244
244
reject ! ( v )
245
- if ( sync ) throw v
245
+ if ( snapshot [ SYNC ] ) throw v
246
246
}
247
247
this . _snapshot = { ac : new AbortController ( ) , ...snapshot }
248
248
if ( this . _snapshot . halt ) this . _stage = 'halted '
0 commit comments