-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated bin scripts for package release
- Loading branch information
1 parent
e1ff8de
commit 8600804
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.