From 9711087b2b67ad6cfa3914c0fdc30ed96cad5dd8 Mon Sep 17 00:00:00 2001 From: Manas Jayanth <3097018+ManasJayanth@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:20:11 +0530 Subject: [PATCH] Makes esyInstallRelease.js copying optional --- dist/index.js | 10 ++++++++-- index.ts | 15 ++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/dist/index.js b/dist/index.js index d8089d5..39c5748 100644 --- a/dist/index.js +++ b/dist/index.js @@ -141605,8 +141605,14 @@ function bundleNPMArtifacts() { acc.push(folderName); return acc; }, []); - const esyInstallReleaseJS = "esyInstallRelease.js"; - external_fs_.cpSync(external_path_.join(releaseFolder, artifactFoldersList[0], esyInstallReleaseJS), external_path_.join(releaseFolder, esyInstallReleaseJS)); + try { + const esyInstallReleaseJS = "esyInstallRelease.js"; + external_fs_.cpSync(external_path_.join(releaseFolder, artifactFoldersList[0], esyInstallReleaseJS), external_path_.join(releaseFolder, esyInstallReleaseJS)); + } + catch (e) { + console.warn("Could not copy esyInstallRelease.js", e); + console.log("Skipping esyInstallRelease.js as it is optional"); + } console.log("Creating package.json"); const possibleEsyJsonPath = external_path_.join(workingDirectory, "esy.json"); const possiblePackageJsonPath = external_path_.join(workingDirectory, "package.json"); diff --git a/index.ts b/index.ts index 745e009..000db77 100644 --- a/index.ts +++ b/index.ts @@ -360,11 +360,16 @@ async function bundleNPMArtifacts() { }, [] ); - const esyInstallReleaseJS = "esyInstallRelease.js"; - fs.cpSync( - path.join(releaseFolder, artifactFoldersList[0], esyInstallReleaseJS), - path.join(releaseFolder, esyInstallReleaseJS) - ); + try { + const esyInstallReleaseJS = "esyInstallRelease.js"; + fs.cpSync( + path.join(releaseFolder, artifactFoldersList[0], esyInstallReleaseJS), + path.join(releaseFolder, esyInstallReleaseJS) + ); + } catch (e) { + console.warn("Could not copy esyInstallRelease.js", e); + console.log("Skipping esyInstallRelease.js as it is optional"); + } console.log("Creating package.json"); const possibleEsyJsonPath = path.join(workingDirectory, "esy.json"); const possiblePackageJsonPath = path.join(workingDirectory, "package.json");