@taito-project-eu/cli 0.1.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/README.md ADDED
@@ -0,0 +1,2 @@
1
+
2
+ ![taito-project-logo](https://raw.githubusercontent.com/taito-project/.github/main/assets/header.png)
package/bin/taito.js ADDED
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require('child_process');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ // Map Node's os.platform() and os.arch() to your binary filenames
8
+ const platform = os.platform(); // 'linux', 'darwin', 'win32'
9
+ const arch = os.arch(); // 'x64', 'arm64'
10
+
11
+ const binaryMap = {
12
+ 'darwin-arm64': 'taito-darwin-arm64',
13
+ 'darwin-x64': 'taito-darwin-amd64',
14
+ 'linux-x64': 'taito-linux-amd64',
15
+ };
16
+
17
+ const binaryName = binaryMap[`${platform}-${arch}`];
18
+
19
+ if (!binaryName) {
20
+ console.error(`Unsupported platform/architecture: ${platform}-${arch}`);
21
+ process.exit(1);
22
+ }
23
+
24
+ const binaryPath = path.join(__dirname, '..', 'binaries', binaryName);
25
+
26
+ // Run the Go binary
27
+ const child = spawn(binaryPath, process.argv.slice(2), {
28
+ stdio: 'inherit' // This passes through colors, prompts, and logs
29
+ });
30
+
31
+ child.on('exit', (code) => {
32
+ process.exit(code);
33
+ });
Binary file
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@taito-project-eu/cli",
3
+ "version": "0.1.1",
4
+ "bin": {
5
+ "taito": "bin/taito.js"
6
+ },
7
+ "files": [
8
+ "bin/",
9
+ "binaries/"
10
+ ]
11
+ }