Skip to content

Commit

Permalink
fix: update bunx command in develop.ts and new.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn committed Jul 16, 2024
1 parent cdaa2b6 commit 44805dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
9 changes: 1 addition & 8 deletions packages/pylon-cli/src/commands/develop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ import path from 'path'
import {sfiBuildPath, sfiSourcePath} from '../constants.js'

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

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

Expand Down
6 changes: 3 additions & 3 deletions packages/pylon-cli/src/commands/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ export default async (
// Insert the client path into the package.json file (gqty key)
if (options.clientPath) {
logger.info('Inserting client path into package.json')
await Bun.$`cd "${projectDir}" && npx json --yes -q -I -f package.json -e 'this.pylon = this.pylon || {}; this.pylon.gqty="${options.clientPath}"'`
await Bun.$`cd "${projectDir}" && bunx json --yes -q -I -f package.json -e 'this.pylon = this.pylon || {}; this.pylon.gqty="${options.clientPath}"'`

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 --yes json -q -I -f package.json -e 'this.devDependencies = this.devDependencies || {}; this.devDependencies["@gqty/react"] = "*"'`
await Bun.$`bunx --yes 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"] = "*"'`
await Bun.$`bunx --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 44805dc

Please sign in to comment.