homebutler 1.5.0 → 1.7.0
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/install.js +13 -1
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -85,6 +85,18 @@ async function downloadAndExtract() {
|
|
|
85
85
|
const assetName = `homebutler_${version}_${os}_${cpu}.${ext}`;
|
|
86
86
|
const url = `https://github.com/${REPO}/releases/download/${tag}/${assetName}`;
|
|
87
87
|
|
|
88
|
+
// Windows has no unzip. Its own tar.exe, in System32 since Windows 10
|
|
89
|
+
// 1803, reads a zip; named by path, because the tar that Git for Windows
|
|
90
|
+
// puts first on PATH is GNU tar, which does not. Checked before the
|
|
91
|
+
// download, so an older Windows is told what to do instead of ENOENT.
|
|
92
|
+
const winTar = path.join(process.env.SystemRoot || "C:\\Windows", "System32", "tar.exe");
|
|
93
|
+
if (ext === "zip" && !fs.existsSync(winTar)) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
`${winTar} was not found; it comes with Windows 10 1803 and later. ` +
|
|
96
|
+
`Download ${url}, extract homebutler.exe from it, and put it at ${BIN_PATH}`
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
88
100
|
process.stderr.write(`Downloading homebutler ${tag} for ${os}/${cpu}...\n`);
|
|
89
101
|
|
|
90
102
|
fs.mkdirSync(BIN_DIR, { recursive: true });
|
|
@@ -97,7 +109,7 @@ async function downloadAndExtract() {
|
|
|
97
109
|
if (ext === "tar.gz") {
|
|
98
110
|
execSync(`tar -xzf "${tmpFile}" -C "${BIN_DIR}"`, { stdio: "pipe" });
|
|
99
111
|
} else {
|
|
100
|
-
execSync(`
|
|
112
|
+
execSync(`"${winTar}" -xf "${tmpFile}" -C "${BIN_DIR}"`, { stdio: "pipe" });
|
|
101
113
|
}
|
|
102
114
|
|
|
103
115
|
// Find the binary (goreleaser puts it inside a directory or at root)
|
package/package.json
CHANGED