@hybridlabor-api/bdb-synapse 1.0.4 → 1.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/bin/synapse.js +26 -0
- package/package.json +1 -1
package/bin/synapse.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
|
|
7
|
+
const projectRoot = path.resolve(__dirname, '..');
|
|
8
|
+
|
|
9
|
+
// Überprüfen, ob Go installiert ist
|
|
10
|
+
const goCheck = spawnSync('go', ['version'], { encoding: 'utf-8' });
|
|
11
|
+
if (goCheck.error || goCheck.status !== 0) {
|
|
12
|
+
console.error("\x1b[31m%s\x1b[0m", "Fehler: Go (Golang) ist auf diesem System nicht installiert oder nicht im PATH!");
|
|
13
|
+
console.error("Da dies eine 'npx' on-the-fly Ausführung ist, wird Go benötigt, um den Quellcode zu kompilieren.");
|
|
14
|
+
console.error("Installiere BDB Synapse idealerweise als pre-compiled Binary über:");
|
|
15
|
+
console.error("\x1b[36m%s\x1b[0m", " npx @hybridlabor-api/bdb-dev-optimized-agent-skills@latest");
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// go run ausführen
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
const result = spawnSync('go', ['run', 'cmd/synapse/main.go', ...args], {
|
|
22
|
+
cwd: projectRoot,
|
|
23
|
+
stdio: 'inherit'
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
process.exit(result.status !== null ? result.status : 1);
|