From e5cc6b9e61afa58c8bf2ccd88c68d029ae65f41b Mon Sep 17 00:00:00 2001 From: Manas Jayanth <3097018+ManasJayanth@users.noreply.github.com> Date: Fri, 31 May 2024 16:26:43 +0530 Subject: [PATCH] wip --- dist/index.js | 8 +++++--- index.ts | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 5db85c7..cec975c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -176204,9 +176204,11 @@ function bundleNPMArtifacts() { return acc; }, []); console.log("Creating package.json"); - const mainPackageJsonPath = external_fs_.existsSync("esy.json") - ? "esy.json" - : "package.json"; + const possibleEsyJsonPath = external_path_.join(workingDirectory, "esy.json"); + const possiblePackageJsonPath = external_path_.join(workingDirectory, "package.json"); + const mainPackageJsonPath = external_fs_.existsSync(possibleEsyJsonPath) + ? possibleEsyJsonPath + : possiblePackageJsonPath; const exists = external_fs_.existsSync(external_path_.join(workingDirectory, mainPackageJsonPath)); if (!exists) { console.error("No package.json or esy.json at " + mainPackageJsonPath); diff --git a/index.ts b/index.ts index 9f1b76b..575861b 100644 --- a/index.ts +++ b/index.ts @@ -176,9 +176,11 @@ async function bundleNPMArtifacts() { [] ); console.log("Creating package.json"); - const mainPackageJsonPath = fs.existsSync("esy.json") - ? "esy.json" - : "package.json"; + const possibleEsyJsonPath = path.join(workingDirectory, "esy.json"); + const possiblePackageJsonPath = path.join(workingDirectory, "package.json"); + const mainPackageJsonPath = fs.existsSync(possibleEsyJsonPath) + ? possibleEsyJsonPath + : possiblePackageJsonPath; const exists = fs.existsSync( path.join(workingDirectory, mainPackageJsonPath) );