Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 17, 2024
1 parent 387c35f commit 665fdd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/modes/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default async function(args: string[], { pkgs, ...opts }: { pkgs: Package
const pkgs_str = () => pkgenv.installations.map(({pkg}) => dim(utils.pkg.str(pkg))).join(", ")

for (const key in env) {
env[key] = env[key].replaceAll(`\${${key}}`, Deno.env.get(key) ?? '')
env[key] = env[key].replaceAll(new RegExp(`\\\${${key}.*?}`, 'g'), (v => v ? `:${v}` : '')(Deno.env.get(key)))
}

console.error('this is a temporary shell containing the following packages:')
Expand All @@ -40,7 +40,7 @@ function shell() {
cmd.splice(1, 0, '--norc', '--noprofile') // longopts must precede shortopts
// fall through
case 'sh':
PS1 = "\\[\\033[38;5;86m\\]pkgx\\[\\033[0m\\] %~ "
PS1 = "\\[\\033[38;5;63m\\]pkgx\\[\\033[0m\\] %~ "
break
case 'zsh':
PS1 = "%F{086}pkgx%F{reset} %~ "
Expand Down
2 changes: 1 addition & 1 deletion src/modes/x.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default async function({ args, unknown, pkgs: dry, ...opts }: {
const env = await construct_env(pkgenv)

for (const key in env) {
env[key] = env[key].replaceAll(`\${${key}}`, getenv(key) ?? '')
env[key] = env[key].replaceAll(new RegExp(`\\\${${key}.*?}`, 'g'), (v => v ? `:${v}` : '')(Deno.env.get(key)))
}

// fork bomb protection
Expand Down

0 comments on commit 665fdd9

Please sign in to comment.