Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: finos/perspective
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fa5c317816e70c83627423ebf7dab89162c60507
Choose a base ref
..
head repository: finos/perspective
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6a195f8240f20170a1ac93e3f46c1b9d7e84b61a
Choose a head ref
Showing with 17 additions and 5 deletions.
  1. +17 −5 scripts/publish.js
22 changes: 17 additions & 5 deletions scripts/publish.js
Original file line number Diff line number Diff line change
@@ -270,7 +270,6 @@ function askQuestion(query) {
await Promise.all(
js_dist_folders.map(async (artifact) => {
// Download the Artifact
console.log;
const download = await octokit.request(
"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}",
{
@@ -289,13 +288,26 @@ function askQuestion(query) {
})
);

async function isError(promise) {
try {
await promise;
return false;
} catch (e) {
return true;
}
}

// Unzip the folders
await Promise.all(
js_dist_folders.map(async (artifact) => {
await fs.rm(gh_js_dist_aliases[artifact.name], {
recursive: true,
});
const js_dist_dir = gh_js_dist_aliases[artifact.name];
if (!(await isError(fs.stat(js_dist_dir)))) {
await fs.rm(js_dist_dir, {
recursive: true,
});
}

await fs.mkdir(js_dist_dir);
await decompress(
`${js_dist_folder}/${artifact.name}.zip`,
gh_js_dist_aliases[artifact.name],
@@ -363,7 +375,7 @@ function askQuestion(query) {
}
}
} catch (e) {
console.error(e.message);
console.error(e);
process.exit(1);
}
})();