@atlaspack/apvm 0.0.2-dev.3721 → 0.0.2-dev.3737
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/apvm.mjs +19 -27
- package/package.json +7 -7
package/apvm.mjs
CHANGED
|
@@ -1,44 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import * as child_process from 'node:child_process'
|
|
4
|
-
import * as process from
|
|
5
|
-
import * as fs from
|
|
6
|
-
import * as path from
|
|
7
|
-
import * as url from
|
|
3
|
+
import * as child_process from 'node:child_process'
|
|
4
|
+
import * as process from "node:process";
|
|
5
|
+
import * as fs from "node:fs";
|
|
6
|
+
import * as path from "node:path";
|
|
7
|
+
import * as url from "node:url";
|
|
8
8
|
|
|
9
9
|
const arch = {
|
|
10
|
-
x64: 'amd64',
|
|
11
|
-
arm64: 'arm64',
|
|
10
|
+
'x64': 'amd64',
|
|
11
|
+
'arm64': 'arm64',
|
|
12
12
|
}[process.arch];
|
|
13
13
|
|
|
14
14
|
const platform = {
|
|
15
|
-
linux: 'linux',
|
|
16
|
-
darwin: 'macos',
|
|
17
|
-
win32: 'windows',
|
|
15
|
+
'linux': 'linux',
|
|
16
|
+
'darwin': 'macos',
|
|
17
|
+
'win32': 'windows',
|
|
18
18
|
}[process.platform];
|
|
19
19
|
|
|
20
|
-
let binPath = process.env.APVM_BIN_PATH
|
|
20
|
+
let binPath = process.env.APVM_BIN_PATH
|
|
21
21
|
|
|
22
22
|
if (!binPath) {
|
|
23
|
-
const packageJsonPath = url.fileURLToPath(
|
|
24
|
-
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
const packageJsonDir = path.dirname(packageJsonPath);
|
|
28
|
-
binPath = path.join(
|
|
29
|
-
packageJsonDir,
|
|
30
|
-
packageJson.bin[`apvm-${platform}-${arch}`],
|
|
31
|
-
);
|
|
23
|
+
const packageJsonPath = url.fileURLToPath(import.meta.resolve(`@atlaspack/apvm-${platform}-${arch}/package.json`))
|
|
24
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
|
|
25
|
+
const packageJsonDir = path.dirname(packageJsonPath)
|
|
26
|
+
binPath = path.join(packageJsonDir, packageJson.bin[`apvm-${platform}-${arch}`])
|
|
32
27
|
}
|
|
33
28
|
|
|
34
29
|
if (!fs.existsSync(binPath)) {
|
|
35
30
|
// eslint-disable-next-line no-console
|
|
36
|
-
console.error(`BinaryDoesNotExist: ${binPath}`)
|
|
37
|
-
process.exit(1)
|
|
31
|
+
console.error(`BinaryDoesNotExist: ${binPath}`)
|
|
32
|
+
process.exit(1)
|
|
38
33
|
}
|
|
39
34
|
|
|
40
|
-
const [
|
|
41
|
-
child_process.execFileSync(binPath
|
|
42
|
-
stdio: 'inherit',
|
|
43
|
-
shell: true,
|
|
44
|
-
});
|
|
35
|
+
const [,,...args] = process.argv
|
|
36
|
+
child_process.execFileSync(`${binPath} ${args.join(' ')}`, { stdio: 'inherit', shell: true })
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/apvm",
|
|
3
3
|
"description": "Atlaspack version manager",
|
|
4
|
-
"version": "0.0.2-dev.
|
|
4
|
+
"version": "0.0.2-dev.3737+01507b628",
|
|
5
5
|
"license": "(MIT OR Apache-2.0)",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"bin": {
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"url": "https://github.com/atlassian-labs/atlaspack.git"
|
|
16
16
|
},
|
|
17
17
|
"optionalDependencies": {
|
|
18
|
-
"@atlaspack/apvm-linux-amd64": "0.0.2-dev.
|
|
19
|
-
"@atlaspack/apvm-linux-arm64": "0.0.2-dev.
|
|
20
|
-
"@atlaspack/apvm-macos-amd64": "0.0.2-dev.
|
|
21
|
-
"@atlaspack/apvm-macos-arm64": "0.0.2-dev.
|
|
22
|
-
"@atlaspack/apvm-windows-amd64": "0.0.2-dev.
|
|
18
|
+
"@atlaspack/apvm-linux-amd64": "0.0.2-dev.3737+01507b628",
|
|
19
|
+
"@atlaspack/apvm-linux-arm64": "0.0.2-dev.3737+01507b628",
|
|
20
|
+
"@atlaspack/apvm-macos-amd64": "0.0.2-dev.3737+01507b628",
|
|
21
|
+
"@atlaspack/apvm-macos-arm64": "0.0.2-dev.3737+01507b628",
|
|
22
|
+
"@atlaspack/apvm-windows-amd64": "0.0.2-dev.3737+01507b628"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "01507b628930d24dac9c29f19e2866dee381b09e"
|
|
25
25
|
}
|