Create some files

This commit is contained in:
khai96_
2020-05-08 11:29:39 +07:00
parent a7354264cc
commit cd1794a16e
6 changed files with 65 additions and 0 deletions

18
src/install/run.ts Normal file
View File

@@ -0,0 +1,18 @@
import { spawnSync } from 'child_process'
import { downloadSelfInstaller } from '../self-installer'
import { Inputs } from '../inputs'
export async function runSelfInstaller(inputs: Inputs) {
return spawnSync('node', {
env: {
PNPM_VERSION: inputs.version,
PNPM_DEST: inputs.dest,
PNPM_BIN_DEST: inputs.binDest,
PNPM_REGISTRY: inputs.registry,
},
input: await downloadSelfInstaller(),
stdio: 'inherit',
})
}
export default runSelfInstaller