-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.js
More file actions
24 lines (19 loc) · 742 Bytes
/
cli.js
File metadata and controls
24 lines (19 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env node
const { spawnSync } = require('child_process');
const path = require('path');
const fs = require('fs');
const platform = process.platform;
const binaryName = platform === 'win32' ? 'conductor.exe' : 'conductor';
const binaryPath = path.join(__dirname, 'bin', binaryName);
// Check if binary exists
if (!fs.existsSync(binaryPath)) {
console.error('Error: Binary not found. Please reinstall the package.');
console.error('Run: npm uninstall -g @conductor-oss/conductor-cli && npm install -g @conductor-oss/conductor-cli');
process.exit(1);
}
// Execute the binary with all arguments
const result = spawnSync(binaryPath, process.argv.slice(2), {
stdio: 'inherit',
shell: false
});
process.exit(result.status);