Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #724

Merged
merged 4 commits into from
Feb 25, 2024
Merged

Dev #724

Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { basename, dirname, extname, join, resolve } from 'node:path'
import url from 'node:url'
import { updateArgv } from './goods.js'
import { $, chalk, fetch, ProcessOutput } from './index.js'
import { startRepl } from './repl.js'
import { randomId } from './util.js'
import { installDeps, parseDeps } from './deps.js'

Expand Down Expand Up @@ -72,7 +71,7 @@ await (async function main() {
return
}
if (argv.repl) {
startRepl()
await (await import('./repl.js')).startRepl()
return
}
if (argv.eval) {
Expand Down
8 changes: 6 additions & 2 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ try {
defaults.quote = quote
} catch (err) {
if (process.platform == 'win32') {
defaults.shell = which.sync('powershell.exe')
defaults.quote = quotePowerShell
try {
defaults.shell = which.sync('powershell.exe')
defaults.quote = quotePowerShell
} catch (err) {
// no powershell?
}
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
import chalk from 'chalk'
import os from 'node:os'
import path from 'node:path'
import repl from 'node:repl'
import { inspect } from 'node:util'
import { ProcessOutput, defaults } from './core.js'

export function startRepl() {
export async function startRepl() {
defaults.verbose = false
const r = repl.start({
const r = (await import('node:repl')).start({
prompt: chalk.greenBright.bold('❯ '),
useGlobal: true,
preview: false,
Expand Down
Loading