Skip to content

Commit

Permalink
feat: switch to updated version of tinyexec (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Aug 20, 2024
1 parent abaab74 commit a9f2627
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"lint": "eslint ."
},
"dependencies": {
"@jsdevtools/ez-spawn": "^3.0.4"
"tinyexec": "^0.2.0"
},
"devDependencies": {
"@antfu/eslint-config": "^2.25.1",
Expand Down
27 changes: 16 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions src/install.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { existsSync } from 'node:fs'
import process from 'node:process'
import { resolve } from 'node:path'
import { async as ezspawn } from '@jsdevtools/ez-spawn'
import { x } from 'tinyexec'
import { detectPackageManager } from './detect'

export interface InstallPackageOptions {
Expand Down Expand Up @@ -34,7 +34,7 @@ export async function installPackage(names: string | string[], options: InstallP
if (agent === 'pnpm' && existsSync(resolve(options.cwd ?? process.cwd(), 'pnpm-workspace.yaml')))
args.unshift('-w')

return ezspawn(
return x(
agent,
[
agent === 'yarn'
Expand All @@ -45,8 +45,10 @@ export async function installPackage(names: string | string[], options: InstallP
...names,
].filter(Boolean),
{
stdio: options.silent ? 'ignore' : 'inherit',
cwd: options.cwd,
nodeOptions: {
stdio: options.silent ? 'ignore' : 'inherit',
cwd: options.cwd,
},
},
)
}

0 comments on commit a9f2627

Please sign in to comment.