diff --git a/src/install-pnpm/run.ts b/src/install-pnpm/run.ts index b487b6b..5395663 100644 --- a/src/install-pnpm/run.ts +++ b/src/install-pnpm/run.ts @@ -1,7 +1,7 @@ -import * as core from '@actions/core' +import { addPath, exportVariable } from '@actions/core' import { spawn } from 'child_process' import { execPath } from 'process' -import { join } from 'path' +import path from 'path' import { remove, ensureFile, writeFile } from 'fs-extra' import fetch from 'node-fetch' import { Inputs } from '../inputs' @@ -9,7 +9,7 @@ import { Inputs } from '../inputs' export async function runSelfInstaller(inputs: Inputs): Promise { const { version, dest } = inputs const target = version ? `pnpm@${version}` : 'pnpm' - const pkgJson = join(dest, 'package.json') + const pkgJson = path.join(dest, 'package.json') await remove(dest) await ensureFile(pkgJson) @@ -28,9 +28,9 @@ export async function runSelfInstaller(inputs: Inputs): Promise { cp.on('close', resolve) }) if (exitCode === 0) { - const pnpmHome = join(dest, 'node_modules/.bin') - core.addPath(pnpmHome) - core.exportVariable('PNPM_HOME', pnpmHome) + const pnpmHome = path.join(dest, 'node_modules/.bin') + addPath(pnpmHome) + exportVariable('PNPM_HOME', pnpmHome) } return exitCode }