electrobun 0.1.13-beta.1 → 0.1.13-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli/index.ts +24 -7
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
symlinkSync,
|
|
14
14
|
statSync,
|
|
15
15
|
copyFileSync,
|
|
16
|
+
renameSync,
|
|
16
17
|
} from "fs";
|
|
17
18
|
import { execSync } from "child_process";
|
|
18
19
|
import * as readline from "readline";
|
|
@@ -1752,25 +1753,41 @@ if (commandArg === "init") {
|
|
|
1752
1753
|
// DMG creation for macOS only
|
|
1753
1754
|
if (targetOS === 'macos') {
|
|
1754
1755
|
console.log("creating dmg...");
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1756
|
+
const finalDmgPath = join(buildFolder, `${appFileName}.dmg`);
|
|
1757
|
+
// NOTE: For some ungodly reason using the bare name in CI can conflict with some mysterious
|
|
1758
|
+
// already mounted volume. I suspect the sanitized appFileName can match your github repo
|
|
1759
|
+
// or some other tool is mounting something somewhere. Either way, as a workaround
|
|
1760
|
+
// while creating the dmg for a stable build we temporarily give it a -stable suffix
|
|
1761
|
+
// to match the behaviour of -canary builds.
|
|
1762
|
+
const dmgCreationPath =
|
|
1763
|
+
buildEnvironment === "stable"
|
|
1764
|
+
? join(buildFolder, `${appFileName}-stable.dmg`)
|
|
1765
|
+
: finalDmgPath;
|
|
1766
|
+
const baseVolumeName = sanitizeVolumeNameForHdiutil(appFileName);
|
|
1767
|
+
const dmgVolumeName =
|
|
1768
|
+
buildEnvironment === "stable"
|
|
1769
|
+
? `${baseVolumeName}-stable`
|
|
1770
|
+
: baseVolumeName;
|
|
1758
1771
|
// hdiutil create -volname "YourAppName" -srcfolder /path/to/YourApp.app -ov -format UDZO YourAppName.dmg
|
|
1759
1772
|
// Note: use ULFO (lzfse) for better compatibility with large CEF frameworks and modern macOS
|
|
1760
1773
|
execSync(
|
|
1761
|
-
`hdiutil create -volname "${
|
|
1774
|
+
`hdiutil create -volname "${dmgVolumeName}" -srcfolder ${escapePathForTerminal(
|
|
1762
1775
|
selfExtractingBundle.appBundleFolderPath
|
|
1763
|
-
)} -ov -format ULFO ${escapePathForTerminal(
|
|
1776
|
+
)} -ov -format ULFO ${escapePathForTerminal(dmgCreationPath)}`
|
|
1764
1777
|
);
|
|
1778
|
+
if (buildEnvironment === "stable" && dmgCreationPath !== finalDmgPath) {
|
|
1779
|
+
renameSync(dmgCreationPath, finalDmgPath);
|
|
1780
|
+
}
|
|
1781
|
+
artifactsToUpload.push(finalDmgPath);
|
|
1765
1782
|
|
|
1766
1783
|
if (shouldCodesign) {
|
|
1767
|
-
codesignAppBundle(
|
|
1784
|
+
codesignAppBundle(finalDmgPath);
|
|
1768
1785
|
} else {
|
|
1769
1786
|
console.log("skipping codesign");
|
|
1770
1787
|
}
|
|
1771
1788
|
|
|
1772
1789
|
if (shouldNotarize) {
|
|
1773
|
-
notarizeAndStaple(
|
|
1790
|
+
notarizeAndStaple(finalDmgPath);
|
|
1774
1791
|
} else {
|
|
1775
1792
|
console.log("skipping notarization");
|
|
1776
1793
|
}
|