@solcreek/dew 0.3.1 → 0.3.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/dew +25 -0
- package/package.json +1 -1
- package/scripts/postinstall.js +2 -2
package/bin/dew
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execFileSync } = require("child_process");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const os = require("os");
|
|
5
|
+
const { existsSync } = require("fs");
|
|
6
|
+
|
|
7
|
+
const binDir = path.join(__dirname);
|
|
8
|
+
let binary;
|
|
9
|
+
|
|
10
|
+
if (os.platform() === "win32") {
|
|
11
|
+
binary = path.join(binDir, "dew.exe");
|
|
12
|
+
} else {
|
|
13
|
+
binary = path.join(binDir, "dew-bin");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (!existsSync(binary)) {
|
|
17
|
+
console.error("dew: binary not found. Run: npm rebuild @solcreek/dew");
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
execFileSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
23
|
+
} catch (e) {
|
|
24
|
+
process.exit(e.status || 1);
|
|
25
|
+
}
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -4,7 +4,7 @@ const path = require("path");
|
|
|
4
4
|
const os = require("os");
|
|
5
5
|
|
|
6
6
|
const binDir = path.join(__dirname, "..", "bin");
|
|
7
|
-
const binary = path.join(binDir, "dew");
|
|
7
|
+
const binary = path.join(binDir, "dew-bin");
|
|
8
8
|
|
|
9
9
|
if (!existsSync(binDir)) {
|
|
10
10
|
mkdirSync(binDir, { recursive: true });
|
|
@@ -45,7 +45,7 @@ if (!existsSync(binary)) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// macOS: codesign with virtualization entitlement
|
|
48
|
-
if (os.platform() === "darwin" && existsSync(binary)) {
|
|
48
|
+
if (os.platform() === "darwin" && existsSync(binary) && !binary.endsWith(".exe")) {
|
|
49
49
|
const entitlements = path.join(__dirname, "entitlements.plist");
|
|
50
50
|
if (!existsSync(entitlements)) {
|
|
51
51
|
writeFileSync(
|