gitcraft 0.0.131

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.
Files changed (2) hide show
  1. package/bin/gitcraft.js +29 -0
  2. package/package.json +16 -0
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ const os = require('os');
3
+ const child_process = require('child_process');
4
+ const path = require('path');
5
+
6
+ const platform = os.platform();
7
+ const arch = os.arch();
8
+
9
+ let pkg;
10
+ if (platform === 'linux' && arch === 'arm64') pkg = 'gitcraft-linux-arm64';
11
+ else if (platform === 'linux' && arch === 'x64') pkg = 'gitcraft-linux-x64';
12
+ else if (platform === 'darwin' && arch === 'arm64') pkg = 'gitcraft-darwin-arm64';
13
+ else if (platform === 'darwin' && arch === 'x64') pkg = 'gitcraft-darwin-x64';
14
+ else if (platform === 'win32' && arch === 'x64') pkg = 'gitcraft-windows-x64';
15
+ else {
16
+ console.error(`Unsupported platform: ${platform} ${arch}`);
17
+ process.exit(1);
18
+ }
19
+
20
+ try {
21
+ const pkgPath = require.resolve(`${pkg}/package.json`);
22
+ const binName = platform === 'win32' ? 'gitcraft.exe' : 'gitcraft';
23
+ const binPath = path.join(path.dirname(pkgPath), 'bin', binName);
24
+ child_process.execFileSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
25
+ } catch (e) {
26
+ console.error(`Missing platform package: ${pkg}`);
27
+ console.error(`Run: npm install -g ${pkg}`);
28
+ process.exit(1);
29
+ }
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "gitcraft",
3
+ "version": "0.0.131",
4
+ "description": "A CLI tool for GitHub-related utilities",
5
+ "bin": { "gitcraft": "./bin/gitcraft.js" },
6
+ "files": ["bin/"],
7
+ "license": "Apache-2.0",
8
+ "optionalDependencies": {
9
+ "gitcraft-linux-x64": "0.0.131",
10
+ "gitcraft-linux-arm64": "0.0.131",
11
+ "gitcraft-darwin-x64": "0.0.131",
12
+ "gitcraft-darwin-arm64": "0.0.131",
13
+ "gitcraft-windows-x64": "0.0.131"
14
+ },
15
+ "engines": { "node": ">=14" }
16
+ }