From eb99e9e4c721046c4d24fcacdbcdc8c9ed670f59 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Mon, 7 Feb 2022 03:26:03 +0200 Subject: [PATCH] fix: add pnpm to PATH --- src/install-pnpm/run.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/install-pnpm/run.ts b/src/install-pnpm/run.ts index c79905f..f2e7345 100644 --- a/src/install-pnpm/run.ts +++ b/src/install-pnpm/run.ts @@ -1,3 +1,4 @@ +import * as core from '@actions/core' import { spawn } from 'child_process' import { execPath } from 'process' import { join } from 'path' @@ -22,10 +23,14 @@ export async function runSelfInstaller(inputs: Inputs): Promise { const response = await fetch('https://pnpm.js.org/pnpm.js') response.body.pipe(cp.stdin) - return new Promise((resolve, reject) => { + const result = await new Promise((resolve, reject) => { cp.on('error', reject) cp.on('close', resolve) }) + if (result === 0) { + core.addPath(join(dest, 'node_modules/.bin')) + } + return result } export default runSelfInstaller