mirror of
https://code.forgejo.org/pnpm/action-setup.git
synced 2025-05-18 12:34:46 +00:00
Use node-fetch
This commit is contained in:
parent
738fb9213f
commit
9979c3d928
5 changed files with 41 additions and 744 deletions
|
@ -3,7 +3,7 @@ import { execPath } from 'process'
|
|||
import { downloadSelfInstaller } from '../self-installer'
|
||||
import { Inputs } from '../inputs'
|
||||
|
||||
export function runSelfInstaller(inputs: Inputs): Promise<number> {
|
||||
export async function runSelfInstaller(inputs: Inputs): Promise<number> {
|
||||
const cp = spawn(execPath, {
|
||||
env: {
|
||||
PNPM_VERSION: inputs.version,
|
||||
|
@ -14,7 +14,8 @@ export function runSelfInstaller(inputs: Inputs): Promise<number> {
|
|||
stdio: ['pipe', 'inherit', 'inherit'],
|
||||
})
|
||||
|
||||
downloadSelfInstaller().pipe(cp.stdin)
|
||||
const response = await downloadSelfInstaller()
|
||||
response.body.pipe(cp.stdin)
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
cp.on('error', reject)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import download from 'download'
|
||||
import fetch from 'node-fetch'
|
||||
import url from './url'
|
||||
export const downloadSelfInstaller = () => download(url)
|
||||
export const downloadSelfInstaller = () => fetch(url)
|
||||
export default downloadSelfInstaller
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue