Skip to content

Commit

Permalink
fix(release): fix asset replacer script
Browse files Browse the repository at this point in the history
  • Loading branch information
lsagetlethias committed Sep 19, 2022
1 parent d7105be commit bd21235
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions scripts/replaceForChannel.js
Expand Up @@ -10,11 +10,18 @@ const channel = packageJson.version.includes("beta")
? "next"
: "stable";

console.log("Channel detected:", channel);
if (channel === "stable") {
console.log("[ReplaceForChannel] Replace not need in stable.");
process.exit();
}
console.log("[ReplaceForChannel] Channel detected:", channel);
const productNameReplacement = `"productName": "${productName}${
channel === "stable" ? "" : ` (${channel})`
}"`;
console.log("Replacing product name with", productNameReplacement);
console.log(
"[ReplaceForChannel] Replacing product name with",
productNameReplacement
);
replace({
paths: [packageJsonPath],
recursive: false,
Expand All @@ -26,7 +33,7 @@ replace({
const iconPngReplacement = `"icon": "./electron/build/icon_${
channel === "stable" ? "" : `${channel}`
}.png"`;
console.log("Replacing PNG icon with", iconPngReplacement);
console.log("[ReplaceForChannel] Replacing PNG icon with", iconPngReplacement);
replace({
paths: [packageJsonPath],
recursive: false,
Expand All @@ -38,7 +45,10 @@ replace({
const iconIcnsReplacement = `"icon": "./electron/build/icon_${
channel === "stable" ? "" : `${channel}`
}.icns"`;
console.log("Replacing ICNS icon with", iconIcnsReplacement);
console.log(
"[ReplaceForChannel] Replacing ICNS icon with",
iconIcnsReplacement
);
replace({
paths: [packageJsonPath],
recursive: false,
Expand Down

0 comments on commit bd21235

Please sign in to comment.