Skip to content

Commit

Permalink
feat: add --yes to npx
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn committed Jul 11, 2024
1 parent 5ffd37e commit f7e8da0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion packages/pylon-cli/src/commands/develop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ import path from 'path'
import {sfiBuildPath, sfiSourcePath} from '../constants.js'

export default async (options: {port: string}) => {
const {stdout} = spawnSync(['npx', '-p', 'which', 'which', 'pylon-server'])
const {stdout} = spawnSync([
'npx',
'--yes',
'-p',
'which',
'which',
'pylon-server'
])

const binPath = stdout.toString().trim()

Expand Down
4 changes: 2 additions & 2 deletions packages/pylon-cli/src/commands/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ export default async (
logger.info('Inserted client path into package.json')

// Add @gqty/react and gqty to the cwd package.json and prompt the user to install them
await Bun.$`npx json -q -I -f package.json -e 'this.devDependencies = this.devDependencies || {}; this.devDependencies["@gqty/react"] = "*"'`
await Bun.$`npx --yes json -q -I -f package.json -e 'this.devDependencies = this.devDependencies || {}; this.devDependencies["@gqty/react"] = "*"'`

await Bun.$`npx json -q -I -f package.json -e 'this.devDependencies = this.devDependencies || {}; this.devDependencies["gqty"] = "*"'`
await Bun.$`npx --yes json -q -I -f package.json -e 'this.devDependencies = this.devDependencies || {}; this.devDependencies["gqty"] = "*"'`

logger.info(
'Added @gqty/react and gqty to package.json. Run "install" to install them'
Expand Down

0 comments on commit f7e8da0

Please sign in to comment.