Skip to content

Commit afa0d89

Browse files
committed
wip
1 parent e0a98a3 commit afa0d89

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

dist/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176188,6 +176188,9 @@ function bundleNPMArtifacts() {
176188176188
return __awaiter(this, void 0, void 0, function* () {
176189176189
const releaseFolder = "_npm-release";
176190176190
external_fs_.mkdirSync(releaseFolder);
176191+
const workingDirectory = core.getInput("working-directory") || process.cwd();
176192+
external_fs_.statSync(workingDirectory);
176193+
process.chdir(workingDirectory);
176191176194
const { artifacts } = yield artifact_default().listArtifacts();
176192176195
const artifactFoldersList = yield Promise.all(artifacts.map((a) => __awaiter(this, void 0, void 0, function* () {
176193176196
const folderName = `platform-${a.name}`;
@@ -176204,7 +176207,7 @@ function bundleNPMArtifacts() {
176204176207
const mainPackageJsonPath = external_fs_.existsSync("esy.json")
176205176208
? "esy.json"
176206176209
: "package.json";
176207-
const exists = external_fs_.existsSync(mainPackageJsonPath);
176210+
const exists = external_fs_.existsSync(external_path_.join(workingDirectory, mainPackageJsonPath));
176208176211
if (!exists) {
176209176212
console.error("No package.json or esy.json at " + mainPackageJsonPath);
176210176213
process.exit(1);

index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ async function prepareNPMArtifacts() {
155155
async function bundleNPMArtifacts() {
156156
const releaseFolder = "_npm-release";
157157
fs.mkdirSync(releaseFolder);
158+
const workingDirectory = core.getInput("working-directory") || process.cwd();
159+
fs.statSync(workingDirectory);
160+
process.chdir(workingDirectory);
158161
const { artifacts } = await artifact.listArtifacts();
159162
const artifactFoldersList = await Promise.all(
160163
artifacts.map(async (a: Artifact) => {
@@ -176,7 +179,9 @@ async function bundleNPMArtifacts() {
176179
const mainPackageJsonPath = fs.existsSync("esy.json")
177180
? "esy.json"
178181
: "package.json";
179-
const exists = fs.existsSync(mainPackageJsonPath);
182+
const exists = fs.existsSync(
183+
path.join(workingDirectory, mainPackageJsonPath)
184+
);
180185
if (!exists) {
181186
console.error("No package.json or esy.json at " + mainPackageJsonPath);
182187
process.exit(1);

0 commit comments

Comments
 (0)