diff --git a/dist/index.js b/dist/index.js index d7bafcc..56b4c4d 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/package.json b/package.json index 06ca9f7..31c3921 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,9 @@ "dependencies": { "@actions/core": "^1.10.1", "@types/expand-tilde": "^2.0.2", - "@types/fs-extra": "^11.0.4", "@types/node": "^20.11.5", "@types/node-fetch": "^2.6.11", "expand-tilde": "^2.0.2", - "fs-extra": "^11.2.0", "yaml": "^2.3.4", "zod": "^3.22.4" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 52ec8b3..b42965f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,9 +11,6 @@ dependencies: '@types/expand-tilde': specifier: ^2.0.2 version: 2.0.2 - '@types/fs-extra': - specifier: ^11.0.4 - version: 11.0.4 '@types/node': specifier: ^20.11.5 version: 20.11.5 @@ -23,9 +20,6 @@ dependencies: expand-tilde: specifier: ^2.0.2 version: 2.0.2 - fs-extra: - specifier: ^11.2.0 - version: 11.2.0 yaml: specifier: ^2.3.4 version: 2.3.4 @@ -69,19 +63,6 @@ packages: resolution: {integrity: sha512-wlsMYiapmIR4Eq/Z0qysN8xaDMjSkO6AIDNFx9oxgWGeKVA1jU+NzwPRZErBNP5z6/dx6QNkNpKglBGPO9OkTA==} dev: false - /@types/fs-extra@11.0.4: - resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} - dependencies: - '@types/jsonfile': 6.1.4 - '@types/node': 20.11.5 - dev: false - - /@types/jsonfile@6.1.4: - resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} - dependencies: - '@types/node': 20.11.5 - dev: false - /@types/node-fetch@2.6.11: resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} dependencies: @@ -132,19 +113,6 @@ packages: mime-types: 2.1.35 dev: false - /fs-extra@11.2.0: - resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} - engines: {node: '>=14.14'} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.1 - dev: false - - /graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - dev: false - /homedir-polyfill@1.0.3: resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} engines: {node: '>=0.10.0'} @@ -152,14 +120,6 @@ packages: parse-passwd: 1.0.0 dev: false - /jsonfile@6.1.0: - resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} - dependencies: - universalify: 2.0.1 - optionalDependencies: - graceful-fs: 4.2.11 - dev: false - /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} @@ -205,11 +165,6 @@ packages: '@fastify/busboy': 2.1.0 dev: false - /universalify@2.0.1: - resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} - engines: {node: '>= 10.0.0'} - dev: false - /uuid@8.3.2: resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} hasBin: true diff --git a/src/install-pnpm/run.ts b/src/install-pnpm/run.ts index 72c7e8b..10e20a3 100644 --- a/src/install-pnpm/run.ts +++ b/src/install-pnpm/run.ts @@ -1,6 +1,6 @@ import { addPath, exportVariable } from '@actions/core' import { spawn } from 'child_process' -import { remove, ensureFile, writeFile, readFile } from 'fs-extra' +import { rm, writeFile, readFile, mkdir } from 'fs/promises' import path from 'path' import { execPath } from 'process' import { Inputs } from '../inputs' @@ -9,9 +9,11 @@ export async function runSelfInstaller(inputs: Inputs): Promise { const { version, dest, packageJsonFile, standalone } = inputs // prepare self install - await remove(dest) + await rm(dest, { recursive: true, force: true }) + // create dest directory after removal + await mkdir(dest, { recursive: true }) const pkgJson = path.join(dest, 'package.json') - await ensureFile(pkgJson) + // we have ensured the dest directory exists, we can write the file directly await writeFile(pkgJson, JSON.stringify({ private: true })) // prepare target pnpm