mirror of
https://code.forgejo.org/pnpm/action-setup.git
synced 2025-06-15 00:11:11 +00:00
Complete basic
This commit is contained in:
parent
21f3fd8b57
commit
7d62586afe
3 changed files with 26 additions and 11 deletions
src/install
|
@ -1,17 +1,23 @@
|
|||
import { spawnSync } from 'child_process'
|
||||
import { spawn } from 'child_process'
|
||||
import { downloadSelfInstaller } from '../self-installer'
|
||||
import { Inputs } from '../inputs'
|
||||
|
||||
export async function runSelfInstaller(inputs: Inputs) {
|
||||
return spawnSync('node', {
|
||||
export function runSelfInstaller(inputs: Inputs): Promise<number> {
|
||||
const cp = spawn('node', {
|
||||
env: {
|
||||
PNPM_VERSION: inputs.version,
|
||||
PNPM_DEST: inputs.dest,
|
||||
PNPM_BIN_DEST: inputs.binDest,
|
||||
PNPM_REGISTRY: inputs.registry,
|
||||
},
|
||||
input: await downloadSelfInstaller(),
|
||||
stdio: 'inherit',
|
||||
stdio: ['pipe', 'inherit', 'inherit'],
|
||||
})
|
||||
|
||||
downloadSelfInstaller().pipe(cp.stdin)
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
cp.on('error', reject)
|
||||
cp.on('close', resolve)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue