not always
This commit is contained in:
parent
c244435ae2
commit
0c6ce16bcd
|
|
@ -9,9 +9,6 @@ import { readFileSync } from 'fs'
|
|||
import { spawn } from 'child_process'
|
||||
import { join } from 'path'
|
||||
|
||||
const idx = Bun.argv.indexOf('--')
|
||||
prelude.$.args = idx >= 0 ? Bun.argv.slice(idx + 1) : []
|
||||
|
||||
function showHelp() {
|
||||
console.log(`${colors.bright}${colors.magenta}🦐 Shrimp${colors.reset} is a scripting language in a shell.
|
||||
|
||||
|
|
@ -38,6 +35,9 @@ function showVersion() {
|
|||
}
|
||||
|
||||
async function evalCode(code: string, imports: string[]) {
|
||||
const idx = Bun.argv.indexOf('--')
|
||||
prelude.$.args = idx >= 0 ? Bun.argv.slice(idx + 1) : []
|
||||
|
||||
const importStatement = imports.length > 0 ? `import ${imports.join(' ')}` : ''
|
||||
if (importStatement) code = `${importStatement}; ${code}`
|
||||
return await runCode(code)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user