@yaakapp/cli 0.0.10 → 0.0.11
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.cjs +5 -5
- package/package.json +1 -1
- package/yaakcli/yaakcli +0 -0
package/install.cjs
CHANGED
@@ -10,7 +10,7 @@ const VERSION = "0.0.10";
|
|
10
10
|
const binaryName = process.platform === "win32" ? "yaakcli.exe" : "yaakcli";
|
11
11
|
|
12
12
|
// Compute the path we want to emit the binary to
|
13
|
-
const binaryDstPath = path.join(__dirname, "
|
13
|
+
const binaryDstPath = path.join(__dirname, "yaakcli", binaryName);
|
14
14
|
|
15
15
|
function makeRequest(url) {
|
16
16
|
return new Promise((resolve, reject) => {
|
@@ -71,7 +71,7 @@ function extractFileFromTarball(tarballBuffer, filepath) {
|
|
71
71
|
}
|
72
72
|
}
|
73
73
|
|
74
|
-
async function
|
74
|
+
async function downloadBinary() {
|
75
75
|
// Download the tarball of the right binary distribution package
|
76
76
|
const platform = process.platform === 'win32' ? 'windows' : process.platform;
|
77
77
|
const arch = process.arch === 'x64' ? 'amd64' : process.arch;
|
@@ -101,12 +101,12 @@ async function downloadBinaryFromNpm() {
|
|
101
101
|
}
|
102
102
|
|
103
103
|
function isPlatformSpecificPackageInstalled() {
|
104
|
-
return fs.existsSync(
|
104
|
+
return fs.existsSync(binaryDstPath)
|
105
105
|
}
|
106
106
|
|
107
107
|
// Skip downloading the binary if it was already installed via optionalDependencies
|
108
108
|
if (!isPlatformSpecificPackageInstalled()) {
|
109
|
-
|
109
|
+
downloadBinary().catch(console.error);
|
110
110
|
} else {
|
111
|
-
console.log(
|
111
|
+
console.log(`yaakcli already exists at ${binaryDstPath}`);
|
112
112
|
}
|
package/package.json
CHANGED
package/yaakcli/yaakcli
ADDED
Binary file
|