@package-pal/cli 0.0.2 → 0.0.4
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/ppal +2 -0
- package/package.json +6 -7
- package/src/link-binary.js +5 -5
package/bin/ppal
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@package-pal/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "CLI tool exposing core PackagePal functionality.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"package",
|
|
@@ -12,17 +12,15 @@
|
|
|
12
12
|
],
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"type": "module",
|
|
15
|
-
"
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"typescript": "^5.8.3",
|
|
17
|
+
"@types/bun": "^1.2.19",
|
|
16
18
|
"@clack/prompts": "^0.11.0",
|
|
17
19
|
"@package-pal/core": "^0.0.2",
|
|
18
20
|
"@package-pal/util": "^0.0.4",
|
|
19
21
|
"@stricli/core": "^1.2.0",
|
|
20
22
|
"yoctocolors": "^2.1.1"
|
|
21
23
|
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"typescript": "^5.8.3",
|
|
24
|
-
"@types/bun": "^1.2.19"
|
|
25
|
-
},
|
|
26
24
|
"optionalDependencies": {
|
|
27
25
|
"@package-pal/cli-linux-x64": "0.0.1",
|
|
28
26
|
"@package-pal/cli-linux-x64-musl": "0.0.1",
|
|
@@ -40,7 +38,8 @@
|
|
|
40
38
|
"dppal": "./src/index.ts"
|
|
41
39
|
},
|
|
42
40
|
"files": [
|
|
43
|
-
"
|
|
41
|
+
"src/link-binary.js",
|
|
42
|
+
"bin/ppal"
|
|
44
43
|
],
|
|
45
44
|
"scripts": {
|
|
46
45
|
"postinstall": "node ./src/link-binary.js"
|
package/src/link-binary.js
CHANGED
|
@@ -14,12 +14,12 @@ const usePlatform = platform();
|
|
|
14
14
|
const useArch = arch();
|
|
15
15
|
|
|
16
16
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
-
const
|
|
18
|
-
if (!
|
|
17
|
+
const binName = Object.keys(packageJson.bin)[0];
|
|
18
|
+
if (!binName) {
|
|
19
19
|
throw new Error('Expected bin name.');
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const binName = usePlatform === 'win32' ? `${rawBinName}.exe` : rawBinName;
|
|
22
|
+
// const binName = usePlatform === 'win32' ? `${rawBinName}.exe` : rawBinName;
|
|
23
23
|
const binDir = resolve(
|
|
24
24
|
__dirname, '..', 'bin',
|
|
25
25
|
);
|
|
@@ -67,7 +67,7 @@ if (!platformPackage) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
const binPath = resolve(
|
|
70
|
-
__dirname, '..', '..', platformPackage, binName,
|
|
70
|
+
__dirname, '..', '..', platformPackage, usePlatform === 'win32' ? `${binName}.exe` : binName,
|
|
71
71
|
);
|
|
72
72
|
|
|
73
73
|
if (!existsSync(binPath)) {
|
|
@@ -78,7 +78,7 @@ mkdirSync(binDir, { recursive: true });
|
|
|
78
78
|
|
|
79
79
|
if (usePlatform === 'win32') {
|
|
80
80
|
copyFileSync(binPath, `${binTarget}.exe`);
|
|
81
|
-
writeFileSync(`${binTarget}.cmd`, `@echo off\r\n"%~dp0
|
|
81
|
+
writeFileSync(`${binTarget}.cmd`, `@echo off\r\n"%~dp0\\${binName}.exe" %*\r\n`);
|
|
82
82
|
} else {
|
|
83
83
|
symlinkSync(binPath, binTarget);
|
|
84
84
|
}
|