Skip to content

Commit

Permalink
Updated bin scripts for package release
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-Mallick committed Aug 10, 2024
1 parent e1ff8de commit 8600804
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
38 changes: 38 additions & 0 deletions bin/universal-box.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env node
import { exec } from 'child_process';
import chalk from 'chalk';
import { spawn } from 'child_process';

const [,, command] = process.argv;

console.log(`Command received: ${command}`); // Debugging statement


switch (command) {
case 'init':
console.log('Initializing...'); // Debugging statement
const child = spawn('node', ['index.js'], { stdio: 'inherit' });

child.on('error', (error) => {
console.error(`Error: ${error.message}`);
});

child.on('exit', (code) => {
console.log(`Process exited with code ${code}`);
});
break;

case '--help':
console.log(chalk.blue('For more information, visit the documentation at: https://universal-box.co/'));
console.log(chalk.green('Available commands:'));
console.log(chalk.green(' - universal-box init'));
console.log(chalk.green(' - universal-box deploy'));
break;

case 'deploy':
console.log(chalk.yellow('Deployment utility function is still under development in an UAT environment and will be published soon.'));
break;

default:
console.log(chalk.red('Unknown command. Use "universal-box --help" for available commands.'));
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
},
"main": "index.js",
"type": "module",
"bin": {
"universal-box": "./bin/universal-box.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand Down
Empty file.
Empty file.

0 comments on commit 8600804

Please sign in to comment.