@nevaberry/opencodecommit 1.1.0 → 1.1.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/occ +7 -6
- package/index.js +2 -19
- package/package.json +6 -6
- package/platforms/darwin-arm64/.gitkeep +0 -0
- package/platforms/darwin-arm64/occ +0 -0
- package/platforms/darwin-x64/.gitkeep +0 -0
- package/platforms/darwin-x64/occ +0 -0
- package/platforms/linux-arm64/.gitkeep +0 -0
- package/platforms/linux-arm64/occ +0 -0
- package/platforms/linux-x64/.gitkeep +0 -0
- package/platforms/linux-x64/occ +0 -0
- package/platforms/win32-x64/.gitkeep +0 -0
- package/platforms/win32-x64/occ.exe +0 -0
- package/scripts/postinstall.js +0 -41
package/bin/occ
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const { execFileSync } = require("child_process")
|
|
3
|
-
const { getBinaryPath } = require("
|
|
2
|
+
const { execFileSync } = require("child_process")
|
|
3
|
+
const { getBinaryPath } = require("opencodecommit")
|
|
4
|
+
|
|
4
5
|
try {
|
|
5
|
-
execFileSync(getBinaryPath(), process.argv.slice(2), { stdio: "inherit" })
|
|
6
|
+
execFileSync(getBinaryPath(), process.argv.slice(2), { stdio: "inherit" })
|
|
6
7
|
} catch (err) {
|
|
7
|
-
if (err.status) process.exit(err.status)
|
|
8
|
-
console.error(err.message)
|
|
9
|
-
process.exit(1)
|
|
8
|
+
if (err.status) process.exit(err.status)
|
|
9
|
+
console.error(err.message)
|
|
10
|
+
process.exit(1)
|
|
10
11
|
}
|
package/index.js
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// Used by: require("opencodecommit") in programmatic contexts.
|
|
4
|
-
|
|
5
|
-
const path = require("path")
|
|
6
|
-
|
|
7
|
-
const SUPPORTED = ["linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64", "win32-x64"]
|
|
8
|
-
|
|
9
|
-
function getBinaryPath() {
|
|
10
|
-
const platform = `${process.platform}-${process.arch}`
|
|
11
|
-
if (!SUPPORTED.includes(platform)) {
|
|
12
|
-
throw new Error(`opencodecommit: unsupported platform ${platform}`)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const ext = process.platform === "win32" ? ".exe" : ""
|
|
16
|
-
return path.join(__dirname, "platforms", platform, `occ${ext}`)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
module.exports = { getBinaryPath, SUPPORTED }
|
|
1
|
+
// Re-export the unscoped package so programmatic require() behaves the same.
|
|
2
|
+
module.exports = require("opencodecommit")
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nevaberry/opencodecommit",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.4",
|
|
4
|
+
"description": "Scoped alias for opencodecommit — install opencodecommit instead",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -13,13 +13,10 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"bin",
|
|
16
|
-
"scripts",
|
|
17
|
-
"platforms",
|
|
18
16
|
"index.js"
|
|
19
17
|
],
|
|
20
18
|
"scripts": {
|
|
21
|
-
"prepack": "cp ../../README.md . 2>/dev/null || true"
|
|
22
|
-
"postinstall": "node scripts/postinstall.js"
|
|
19
|
+
"prepack": "cp ../../README.md . 2>/dev/null || true"
|
|
23
20
|
},
|
|
24
21
|
"keywords": [
|
|
25
22
|
"git",
|
|
@@ -32,5 +29,8 @@
|
|
|
32
29
|
],
|
|
33
30
|
"engines": {
|
|
34
31
|
"node": ">=18"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"opencodecommit": "1.1.4"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
package/platforms/darwin-x64/occ
DELETED
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
package/platforms/linux-x64/occ
DELETED
|
Binary file
|
|
File without changes
|
|
Binary file
|
package/scripts/postinstall.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Resolve the platform-specific binary and symlink it to bin/opencodecommit
|
|
3
|
-
|
|
4
|
-
const fs = require("fs")
|
|
5
|
-
const path = require("path")
|
|
6
|
-
|
|
7
|
-
const SUPPORTED = ["linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64", "win32-x64"]
|
|
8
|
-
|
|
9
|
-
const platform = `${process.platform}-${process.arch}`
|
|
10
|
-
|
|
11
|
-
if (!SUPPORTED.includes(platform)) {
|
|
12
|
-
console.error(`opencodecommit: unsupported platform ${platform}`)
|
|
13
|
-
console.error(`Supported: ${SUPPORTED.join(", ")}`)
|
|
14
|
-
process.exit(0) // Don't fail install, just warn
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
const ext = process.platform === "win32" ? ".exe" : ""
|
|
19
|
-
const binaryPath = path.join(__dirname, "..", "platforms", platform, `occ${ext}`)
|
|
20
|
-
const binTarget = path.join(__dirname, "..", "bin", `occ${ext}`)
|
|
21
|
-
|
|
22
|
-
if (!fs.existsSync(binaryPath)) {
|
|
23
|
-
console.error(`opencodecommit: binary not found at ${binaryPath}`)
|
|
24
|
-
process.exit(0)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Remove existing symlink/file
|
|
28
|
-
try { fs.unlinkSync(binTarget) } catch { /* ok */ }
|
|
29
|
-
|
|
30
|
-
// Create symlink (or copy on Windows)
|
|
31
|
-
if (process.platform === "win32") {
|
|
32
|
-
fs.copyFileSync(binaryPath, binTarget)
|
|
33
|
-
} else {
|
|
34
|
-
fs.symlinkSync(binaryPath, binTarget)
|
|
35
|
-
fs.chmodSync(binTarget, 0o755)
|
|
36
|
-
}
|
|
37
|
-
} catch (err) {
|
|
38
|
-
console.error(`opencodecommit: failed to link binary for ${platform}`)
|
|
39
|
-
console.error(err.message)
|
|
40
|
-
process.exit(0) // Don't fail install
|
|
41
|
-
}
|