File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -151,13 +151,13 @@ async function runScript(
151
151
152
152
async function readScript ( ) {
153
153
const [ firstArg ] = argv . _
154
- updateArgv ( argv . _ . slice ( firstArg === undefined ? 0 : 1 ) )
155
-
156
154
let script = ''
157
155
let scriptPath = ''
158
156
let tempPath = ''
157
+ let argSlice = 1
159
158
160
159
if ( argv . eval ) {
160
+ argSlice = 0
161
161
script = argv . eval
162
162
tempPath = getFilepath ( $ . cwd , 'zx' , argv . ext )
163
163
} else if ( ! firstArg || firstArg === '-' ) {
@@ -169,7 +169,6 @@ async function readScript() {
169
169
throw new Error ( 'No script provided' )
170
170
}
171
171
} else if ( / ^ h t t p s ? : / . test ( firstArg ) ) {
172
- script = await readScriptFromHttp ( firstArg )
173
172
const { name, ext = argv . ext } = path . parse ( new URL ( firstArg ) . pathname )
174
173
tempPath = getFilepath ( $ . cwd , name , ext )
175
174
} else {
@@ -187,6 +186,7 @@ async function readScript() {
187
186
script = transformMarkdown ( script )
188
187
tempPath = getFilepath ( dir , base )
189
188
}
189
+ if ( argSlice ) updateArgv ( argv . _ . slice ( 1 ) )
190
190
191
191
return { script, scriptPath, tempPath }
192
192
}
You can’t perform that action at this time.
0 commit comments