refactor: install pnpm

This commit is contained in:
Zoltan Kochan 2024-05-06 23:12:40 +02:00
parent 7ce3debe10
commit dc94400d10
No known key found for this signature in database
GPG Key ID: 649E4D4AF74E7DEC
2 changed files with 10 additions and 8 deletions

8
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,10 @@
import { addPath, exportVariable } from '@actions/core' import { addPath, exportVariable } from '@actions/core'
import { spawn } from 'child_process' import { spawn } from 'child_process'
import { rm, writeFile, readFile, mkdir } from 'fs/promises' import { rm, writeFile, mkdir } from 'fs/promises'
import { readFileSync } from 'fs'
import path from 'path' import path from 'path'
import { execPath } from 'process' import { execPath } from 'process'
import util from 'util'
import { Inputs } from '../inputs' import { Inputs } from '../inputs'
export async function runSelfInstaller(inputs: Inputs): Promise<number> { export async function runSelfInstaller(inputs: Inputs): Promise<number> {
@ -47,10 +49,10 @@ async function readTarget(opts: {
if (GITHUB_WORKSPACE) { if (GITHUB_WORKSPACE) {
try { try {
({ packageManager } = JSON.parse(await readFile(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8'))) ({ packageManager } = JSON.parse(readFileSync(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8')))
} catch (error) { } catch (error: unknown) {
// Swallow error if package.json doesn't exist in root // Swallow error if package.json doesn't exist in root
if (error.code !== 'ENOENT') throw error if (!util.types.isNativeError(error) || !('code' in error) || error.code !== 'ENOENT') throw error
} }
} }