fix: do not download pnpm from get.pnpm.io (#46)

* fix: do not download pnpm from get.pnpm.io

* fix: remove redundant files
This commit is contained in:
Zoltan Kochan 2022-05-28 16:54:43 +03:00 committed by GitHub
parent 57b9359b4c
commit 958500fcab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 268070 additions and 324 deletions

134031
src/install-pnpm/pnpm.js Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,4 @@
import { addPath, exportVariable } from '@actions/core'
import fetch from '@pnpm/fetch'
import { spawn } from 'child_process'
import { remove, ensureFile, writeFile, readFile } from 'fs-extra'
import path from 'path'
@ -17,15 +16,11 @@ export async function runSelfInstaller(inputs: Inputs): Promise<number> {
// prepare target pnpm
const target = await readTarget(version)
const cp = spawn(execPath, ['-', 'install', target, '--no-lockfile'], {
const cp = spawn(execPath, [path.join(__dirname, 'pnpm.js'), 'install', target, '--no-lockfile'], {
cwd: dest,
stdio: ['pipe', 'inherit', 'inherit'],
})
const response = await fetch('https://get.pnpm.io/v6.16.js')
if (!response.body) throw new Error('Did not receive response body')
response.body.pipe(cp.stdin)
const exitCode = await new Promise<number>((resolve, reject) => {
cp.on('error', reject)
cp.on('close', resolve)