flying-lobster 1.6.1 → 1.6.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/bin/cli.js +21 -5
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -56,12 +56,19 @@ function findBuiltApp(projectRoot) {
|
|
|
56
56
|
function findBuiltDmg(projectRoot) {
|
|
57
57
|
const distDir = path.join(projectRoot, 'dist');
|
|
58
58
|
|
|
59
|
-
// Look for
|
|
59
|
+
// Look for the most recent .dmg file in dist
|
|
60
60
|
if (fs.existsSync(distDir)) {
|
|
61
|
-
const files = fs.readdirSync(distDir)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
const files = fs.readdirSync(distDir)
|
|
62
|
+
.filter(f => f.endsWith('.dmg') && !f.endsWith('.blockmap'))
|
|
63
|
+
.map(f => ({
|
|
64
|
+
name: f,
|
|
65
|
+
path: path.join(distDir, f),
|
|
66
|
+
mtime: fs.statSync(path.join(distDir, f)).mtime.getTime()
|
|
67
|
+
}))
|
|
68
|
+
.sort((a, b) => b.mtime - a.mtime); // newest first
|
|
69
|
+
|
|
70
|
+
if (files.length > 0) {
|
|
71
|
+
return files[0].path;
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
74
|
|
|
@@ -81,6 +88,15 @@ async function install() {
|
|
|
81
88
|
await runCommand('npm', ['install', '--include=dev'], { cwd: projectRoot });
|
|
82
89
|
}
|
|
83
90
|
|
|
91
|
+
// Clean up old DMGs to avoid confusion
|
|
92
|
+
const distDir = path.join(projectRoot, 'dist');
|
|
93
|
+
if (fs.existsSync(distDir)) {
|
|
94
|
+
const oldDmgs = fs.readdirSync(distDir).filter(f => f.endsWith('.dmg'));
|
|
95
|
+
oldDmgs.forEach(f => {
|
|
96
|
+
try { fs.unlinkSync(path.join(distDir, f)); } catch (e) {}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
84
100
|
// Build the DMG (standard Mac installer experience)
|
|
85
101
|
try {
|
|
86
102
|
await runCommand('npm', ['run', 'build'], { cwd: projectRoot });
|