From 0c6ce16bcde8631f880f0570ffcb3e8e97fa1856 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Mon, 10 Nov 2025 01:00:33 -0800 Subject: [PATCH] not always --- bin/shrimp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/shrimp b/bin/shrimp index 04169bf..6e5d502 100755 --- a/bin/shrimp +++ b/bin/shrimp @@ -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)