s9n-devops-agent 2.0.0 → 2.0.2
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/cs-devops-agent +16 -1
- package/package.json +1 -1
package/bin/cs-devops-agent
CHANGED
|
@@ -51,8 +51,23 @@ switch(command) {
|
|
|
51
51
|
case 'start':
|
|
52
52
|
case 'session':
|
|
53
53
|
// Start interactive session manager
|
|
54
|
+
// Try bash script first (for Unix/Mac), fallback to Node implementation for Windows
|
|
54
55
|
const sessionScript = join(rootDir, 'start-devops-session.sh');
|
|
55
|
-
|
|
56
|
+
|
|
57
|
+
if (process.platform === 'win32') {
|
|
58
|
+
// On Windows, check if bash is available, otherwise use Node coordinator
|
|
59
|
+
import('child_process').then(({ execSync }) => {
|
|
60
|
+
try {
|
|
61
|
+
execSync('bash --version', { stdio: 'ignore' });
|
|
62
|
+
// Bash is available, use the shell script
|
|
63
|
+
runShellScript(sessionScript, args.slice(1));
|
|
64
|
+
} catch (e) {
|
|
65
|
+
// Bash not available, use Node.js session coordinator directly
|
|
66
|
+
console.log('Starting DevOps Agent session manager...\n');
|
|
67
|
+
runScript(join(rootDir, 'src', 'session-coordinator.js'), ['start', ...args.slice(1)]);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
} else if (fs.existsSync(sessionScript)) {
|
|
56
71
|
runShellScript(sessionScript, args.slice(1));
|
|
57
72
|
} else {
|
|
58
73
|
console.error('Session script not found. Please ensure the package is properly installed.');
|
package/package.json
CHANGED