Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Do not fail if binary was already installed #70

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 27 additions & 21 deletions .ci/release-postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,28 +150,34 @@ var copyPlatformBinaries = (platformPath) => {
});
};

try {
fs.mkdirSync("_export");
} catch (e) {
console.log("Could not create _export folder");
}
if (!fs.existsSync("_export")) {
try {
fs.mkdirSync("_export");
} catch (e) {
console.log("Could not create _export folder");
}

switch (platform) {
case "win32":
if (arch() !== "x64") {
console.warn("error: x86 is currently not supported on Windows");
switch (platform) {
case "win32":
if (arch() !== "x64") {
console.warn("error: x86 is currently not supported on Windows");
process.exit(1);
}

copyPlatformBinaries("windows-x64");
break;
case "linux":
case "darwin":
copyPlatformBinaries(platform);
break;
default:
console.warn("error: no release built for the " + platform + " platform");
process.exit(1);
}
}

copyPlatformBinaries("windows-x64");
break;
case "linux":
case "darwin":
copyPlatformBinaries(platform);
break;
default:
console.warn("error: no release built for the " + platform + " platform");
process.exit(1);
require("./esyInstallRelease");
} else {
console.log(
"✨ It looks like the binary was already linked (maybe you are using node_modules cache). Skipping the installation step."
);
}

require("./esyInstallRelease");