@balena/compose-parser 0.0.4 → 0.0.5
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/package.json +6 -4
- package/scripts/rename-binary.js +29 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balena/compose-parser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Wraps compose-go to parse balena-compatible docker-compose.yml files",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf dist",
|
|
@@ -14,13 +14,15 @@
|
|
|
14
14
|
"test:compose": "(docker compose -f docker-compose.test.yml run --build --rm sut || docker compose logs); npm run compose:down",
|
|
15
15
|
"compose:down": "docker compose -f docker-compose.test.yml down --volumes",
|
|
16
16
|
"prepack": "npm run build",
|
|
17
|
-
"install": "node-pre-gyp install --fallback-to-build=false || npm run build:go"
|
|
17
|
+
"install": "node-pre-gyp install --fallback-to-build=false || npm run build:go",
|
|
18
|
+
"postinstall": "node scripts/rename-binary.js"
|
|
18
19
|
},
|
|
19
20
|
"files": [
|
|
20
21
|
"dist/",
|
|
21
22
|
"lib/go.mod",
|
|
22
23
|
"lib/go.sum",
|
|
23
|
-
"lib/main.go"
|
|
24
|
+
"lib/main.go",
|
|
25
|
+
"scripts/rename-binary.js"
|
|
24
26
|
],
|
|
25
27
|
"repository": {
|
|
26
28
|
"type": "git",
|
|
@@ -67,6 +69,6 @@
|
|
|
67
69
|
"typed-error": "^3.2.2"
|
|
68
70
|
},
|
|
69
71
|
"versionist": {
|
|
70
|
-
"publishedAt": "2025-09-
|
|
72
|
+
"publishedAt": "2025-09-16T22:02:05.563Z"
|
|
71
73
|
}
|
|
72
74
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const binDir = path.join(__dirname, '..', 'bin');
|
|
7
|
+
|
|
8
|
+
if (!fs.existsSync(binDir)) {
|
|
9
|
+
process.exit(0);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Find any file matching balena-compose-go*.node
|
|
13
|
+
const files = fs.readdirSync(binDir).filter(f => f.match(/^balena-compose-go.*\.node$/));
|
|
14
|
+
|
|
15
|
+
if (files.length === 0) {
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const sourceFile = path.join(binDir, files[0]);
|
|
20
|
+
const targetFile = path.join(binDir, `balena-compose-go${process.platform === 'win32' ? '.exe' : ''}`);
|
|
21
|
+
|
|
22
|
+
// Rename the file
|
|
23
|
+
try {
|
|
24
|
+
fs.renameSync(sourceFile, targetFile);
|
|
25
|
+
console.log(`Renamed ${files[0]} to ${path.basename(targetFile)}`);
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.error(`Failed to rename file: ${err.message}`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|