@ox.build/cli 0.0.0 → 0.13.1
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/ox +56 -2
- package/package.json +8 -8
- package/README.md +0 -3
package/bin/ox
CHANGED
|
@@ -1,3 +1,57 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
// This script is the entry point for the @ox.build/cli npm package.
|
|
4
|
+
// It resolves and spawns the correct platform-specific binary from
|
|
5
|
+
// the @ox.build/cli-{os}-{arch} optional dependency packages.
|
|
6
|
+
|
|
7
|
+
const { platform, arch, env, argv } = process;
|
|
8
|
+
const { spawnSync } = require('node:child_process');
|
|
9
|
+
|
|
10
|
+
const PLATFORMS = {
|
|
11
|
+
darwin: {
|
|
12
|
+
arm64: '@ox.build/cli-darwin-arm64/bin/ox',
|
|
13
|
+
},
|
|
14
|
+
linux: {
|
|
15
|
+
x64: '@ox.build/cli-linux-x64/bin/ox',
|
|
16
|
+
arm64: '@ox.build/cli-linux-arm64/bin/ox',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const binPath = env.OX_BINARY || PLATFORMS[platform]?.[arch];
|
|
21
|
+
|
|
22
|
+
if (!binPath) {
|
|
23
|
+
console.error(
|
|
24
|
+
`ox does not ship prebuilt binaries for your platform (${platform}-${arch}).`,
|
|
25
|
+
);
|
|
26
|
+
console.error(
|
|
27
|
+
'You can install from source instead: https://github.com/timescale/ox',
|
|
28
|
+
);
|
|
29
|
+
process.exitCode = 1;
|
|
30
|
+
} else {
|
|
31
|
+
let resolvedPath;
|
|
32
|
+
try {
|
|
33
|
+
resolvedPath = env.OX_BINARY || require.resolve(binPath);
|
|
34
|
+
} catch {
|
|
35
|
+
console.error(
|
|
36
|
+
`Could not find the ox binary for your platform (${platform}-${arch}).`,
|
|
37
|
+
);
|
|
38
|
+
console.error(
|
|
39
|
+
'The platform-specific package may not have been installed correctly.',
|
|
40
|
+
);
|
|
41
|
+
console.error('Try reinstalling: npm install -g @ox.build/cli');
|
|
42
|
+
process.exitCode = 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (resolvedPath) {
|
|
46
|
+
const result = spawnSync(resolvedPath, argv.slice(2), {
|
|
47
|
+
shell: false,
|
|
48
|
+
stdio: 'inherit',
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
if (result.error) {
|
|
52
|
+
throw result.error;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
process.exitCode = result.status;
|
|
56
|
+
}
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ox.build/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "The ox CLI for managing development environments",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/timescale/ox.git"
|
|
9
9
|
},
|
|
10
|
-
"
|
|
11
|
-
"README.md",
|
|
12
|
-
"bin"
|
|
13
|
-
],
|
|
10
|
+
"homepage": "https://ox.build",
|
|
14
11
|
"bin": {
|
|
15
12
|
"ox": "bin/ox"
|
|
16
13
|
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin"
|
|
16
|
+
],
|
|
17
17
|
"optionalDependencies": {
|
|
18
|
-
"@ox.build/cli-linux-x64": "0.
|
|
19
|
-
"@ox.build/cli-linux-arm64": "0.
|
|
20
|
-
"@ox.build/cli-darwin-arm64": "0.
|
|
18
|
+
"@ox.build/cli-linux-x64": "0.13.1",
|
|
19
|
+
"@ox.build/cli-linux-arm64": "0.13.1",
|
|
20
|
+
"@ox.build/cli-darwin-arm64": "0.13.1"
|
|
21
21
|
}
|
|
22
22
|
}
|
package/README.md
DELETED