mirror of
https://code.forgejo.org/pnpm/action-setup.git
synced 2025-05-19 12:54:45 +00:00
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:
parent
57b9359b4c
commit
958500fcab
7 changed files with 268070 additions and 324 deletions
134031
src/install-pnpm/pnpm.js
Normal file
134031
src/install-pnpm/pnpm.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue