@getnote/cli 1.0.0 → 1.0.1
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/scripts/postinstall.js +11 -0
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -43,6 +43,17 @@ async function main() {
|
|
|
43
43
|
const url = getDownloadURL(platform);
|
|
44
44
|
const tmpFile = path.join(os.tmpdir(), `getnote-download-${Date.now()}`);
|
|
45
45
|
|
|
46
|
+
// Skip download if binary already matches current version
|
|
47
|
+
if (fs.existsSync(binaryPath)) {
|
|
48
|
+
try {
|
|
49
|
+
const out = execSync(`"${binaryPath}" version 2>/dev/null || "${binaryPath}" --version 2>/dev/null`, { encoding: 'utf8' }).trim();
|
|
50
|
+
if (out.includes(VERSION)) {
|
|
51
|
+
console.log(`getnote v${VERSION} already installed, skipping download.`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
} catch (_) { /* binary exists but can't run (wrong arch etc.), re-download */ }
|
|
55
|
+
}
|
|
56
|
+
|
|
46
57
|
console.log(`Downloading getnote v${VERSION} for ${platform.platform}/${platform.arch}...`);
|
|
47
58
|
console.log(`URL: ${url}`);
|
|
48
59
|
|