Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ManasJayanth committed May 31, 2024
1 parent e0a98a3 commit afa0d89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176188,6 +176188,9 @@ function bundleNPMArtifacts() {
return __awaiter(this, void 0, void 0, function* () {
const releaseFolder = "_npm-release";
external_fs_.mkdirSync(releaseFolder);
const workingDirectory = core.getInput("working-directory") || process.cwd();
external_fs_.statSync(workingDirectory);
process.chdir(workingDirectory);
const { artifacts } = yield artifact_default().listArtifacts();
const artifactFoldersList = yield Promise.all(artifacts.map((a) => __awaiter(this, void 0, void 0, function* () {
const folderName = `platform-${a.name}`;
Expand All @@ -176204,7 +176207,7 @@ function bundleNPMArtifacts() {
const mainPackageJsonPath = external_fs_.existsSync("esy.json")
? "esy.json"
: "package.json";
const exists = external_fs_.existsSync(mainPackageJsonPath);
const exists = external_fs_.existsSync(external_path_.join(workingDirectory, mainPackageJsonPath));
if (!exists) {
console.error("No package.json or esy.json at " + mainPackageJsonPath);
process.exit(1);
Expand Down
7 changes: 6 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ async function prepareNPMArtifacts() {
async function bundleNPMArtifacts() {
const releaseFolder = "_npm-release";
fs.mkdirSync(releaseFolder);
const workingDirectory = core.getInput("working-directory") || process.cwd();
fs.statSync(workingDirectory);
process.chdir(workingDirectory);
const { artifacts } = await artifact.listArtifacts();
const artifactFoldersList = await Promise.all(
artifacts.map(async (a: Artifact) => {
Expand All @@ -176,7 +179,9 @@ async function bundleNPMArtifacts() {
const mainPackageJsonPath = fs.existsSync("esy.json")
? "esy.json"
: "package.json";
const exists = fs.existsSync(mainPackageJsonPath);
const exists = fs.existsSync(
path.join(workingDirectory, mainPackageJsonPath)
);
if (!exists) {
console.error("No package.json or esy.json at " + mainPackageJsonPath);
process.exit(1);
Expand Down

0 comments on commit afa0d89

Please sign in to comment.