vlt 0.0.0-0.1740089541607 → 0.0.0-10
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/README.md +2 -1
- package/package.json +20 -16
- package/{postinstall.js → postinstall.cjs} +27 -13
- package/vlr +1 -0
- package/vlrx +1 -0
- package/vlt +1 -27
- package/vlx +1 -0
- package/vlxl +1 -0
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vlt",
|
|
3
|
-
"version": "0.0.0-0.1740089541607",
|
|
4
3
|
"description": "The vlt CLI",
|
|
5
|
-
"
|
|
6
|
-
"keywords": [
|
|
7
|
-
"vltpkg"
|
|
8
|
-
],
|
|
4
|
+
"version": "0.0.0-10",
|
|
9
5
|
"repository": {
|
|
10
6
|
"type": "git",
|
|
11
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
12
|
-
"directory": "
|
|
8
|
+
"directory": "infra/cli-compiled"
|
|
13
9
|
},
|
|
10
|
+
"license": "BSD-2-Clause-Patent",
|
|
14
11
|
"type": "module",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"vltpkg"
|
|
14
|
+
],
|
|
15
|
+
"bin": {
|
|
16
|
+
"vlxl": "./vlxl",
|
|
17
|
+
"vlr": "./vlr",
|
|
18
|
+
"vlrx": "./vlrx",
|
|
19
|
+
"vlt": "./vlt",
|
|
20
|
+
"vlx": "./vlx"
|
|
21
|
+
},
|
|
15
22
|
"optionalDependencies": {
|
|
16
|
-
"@vltpkg/cli-
|
|
17
|
-
"@vltpkg/cli-
|
|
18
|
-
"@vltpkg/cli-
|
|
19
|
-
"@vltpkg/cli-
|
|
20
|
-
"@vltpkg/cli-win32-x64": "0.0.0-
|
|
23
|
+
"@vltpkg/cli-linux-x64": "0.0.0-10",
|
|
24
|
+
"@vltpkg/cli-linux-arm64": "0.0.0-10",
|
|
25
|
+
"@vltpkg/cli-darwin-x64": "0.0.0-10",
|
|
26
|
+
"@vltpkg/cli-darwin-arm64": "0.0.0-10",
|
|
27
|
+
"@vltpkg/cli-win32-x64": "0.0.0-10"
|
|
21
28
|
},
|
|
22
29
|
"scripts": {
|
|
23
|
-
"postinstall": "node postinstall.
|
|
24
|
-
},
|
|
25
|
-
"bin": {
|
|
26
|
-
"vlt": "vlt"
|
|
30
|
+
"postinstall": "node postinstall.cjs"
|
|
27
31
|
}
|
|
28
|
-
}
|
|
32
|
+
}
|
|
@@ -4,13 +4,21 @@ const os = require('os')
|
|
|
4
4
|
const { join, dirname, basename } = require('path')
|
|
5
5
|
const fs = require('fs')
|
|
6
6
|
|
|
7
|
+
const execMode = 0o777 & ~process.umask()
|
|
7
8
|
const platform = os.platform()
|
|
8
9
|
const arch = os.arch()
|
|
10
|
+
const isWindows = platform === 'win32'
|
|
9
11
|
const rootPackage = __dirname
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
+
const pkg = JSON.parse(
|
|
13
|
+
fs.readFileSync(join(rootPackage, 'package.json'), 'utf8'),
|
|
12
14
|
)
|
|
13
15
|
|
|
16
|
+
const unlinkSyncSafe = file => {
|
|
17
|
+
try {
|
|
18
|
+
fs.unlinkSync(file)
|
|
19
|
+
} catch {}
|
|
20
|
+
}
|
|
21
|
+
|
|
14
22
|
const platformPkg = (() => {
|
|
15
23
|
try {
|
|
16
24
|
return dirname(
|
|
@@ -31,21 +39,27 @@ const atomicCopySync = (source, target) => {
|
|
|
31
39
|
try {
|
|
32
40
|
fs.copyFileSync(source, tmp)
|
|
33
41
|
fs.renameSync(tmp, target)
|
|
42
|
+
fs.chmodSync(target, execMode)
|
|
34
43
|
} catch (err) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
unlinkSyncSafe(tmp)
|
|
45
|
+
throw new Error(`Could not copy platform bin`, {
|
|
46
|
+
cause: {
|
|
47
|
+
source,
|
|
48
|
+
target,
|
|
49
|
+
tmp,
|
|
50
|
+
err,
|
|
51
|
+
},
|
|
52
|
+
})
|
|
43
53
|
}
|
|
44
54
|
}
|
|
45
55
|
|
|
46
|
-
for (const binPath of
|
|
56
|
+
for (const binPath of Object.values(pkg.bin)) {
|
|
57
|
+
const platformBinPath = `${binPath}${isWindows ? '.exe' : ''}`
|
|
47
58
|
atomicCopySync(
|
|
48
|
-
join(platformPkg,
|
|
49
|
-
join(rootPackage,
|
|
59
|
+
join(platformPkg, platformBinPath),
|
|
60
|
+
join(rootPackage, platformBinPath),
|
|
50
61
|
)
|
|
62
|
+
if (platformBinPath !== binPath) {
|
|
63
|
+
unlinkSyncSafe(join(rootPackage, binPath))
|
|
64
|
+
}
|
|
51
65
|
}
|
package/vlr
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"If this file exists, the postinstall script failed to run."
|
package/vlrx
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"If this file exists, the postinstall script failed to run."
|
package/vlt
CHANGED
|
@@ -1,27 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
4
|
-
|
|
5
|
-
const { readFileSync } = require('fs')
|
|
6
|
-
const { resolve } = require('path')
|
|
7
|
-
const os = require('os')
|
|
8
|
-
|
|
9
|
-
const validPlatforms = Object.keys(
|
|
10
|
-
JSON.parse(readFileSync(resolve(__dirname, 'package.json'), 'utf8'))
|
|
11
|
-
.optionalDependencies,
|
|
12
|
-
).map(name => name.replace('@vltpkg/cli-', ''))
|
|
13
|
-
|
|
14
|
-
const currentPlatform = `${os.platform()}-${os.arch()}`
|
|
15
|
-
|
|
16
|
-
console.error(
|
|
17
|
-
validPlatforms.includes(currentPlatform) ?
|
|
18
|
-
`This is a supported platform but the matching binary was not found.
|
|
19
|
-
This could be due to --no-optional or --ignore-scripts being used when installing.
|
|
20
|
-
Try again without either of those flags.
|
|
21
|
-
Otherwise check for error logs from the postinstall script.`
|
|
22
|
-
: `The current platform is not supported by this package.`,
|
|
23
|
-
)
|
|
24
|
-
console.error(`Valid platforms: ${JSON.stringify(validPlatforms)}`)
|
|
25
|
-
console.error(`Current platform: ${JSON.stringify(currentPlatform)}`)
|
|
26
|
-
|
|
27
|
-
process.exit(1)
|
|
1
|
+
"If this file exists, the postinstall script failed to run."
|
package/vlx
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"If this file exists, the postinstall script failed to run."
|
package/vlxl
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"If this file exists, the postinstall script failed to run."
|