Dollar Dot #49

Merged
defunkt merged 3 commits from dollar-dot into main 2025-11-10 15:13:31 +00:00
Showing only changes of commit 0c6ce16bcd - Show all commits

View File

@ -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)