Compare commits
No commits in common. "02f4e652cb7cb4e59f8403fccf51db88731e6f30" and "33d57752aab9058e1d0613a3712db7fb7d83e4a3" have entirely different histories.
02f4e652cb
...
33d57752aa
34
ngenv
34
ngenv
|
@ -187,6 +187,40 @@ switch (actionVerb) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Process command line arguments
|
||||||
|
if (actionVerb === "start") {
|
||||||
|
} else if (actionVerb === "stop") {
|
||||||
|
// Stop the background process
|
||||||
|
stopBackgroundProcess();
|
||||||
|
} else if (actionVerb === "clear") {
|
||||||
|
// Clear the log files
|
||||||
|
clearLogs();
|
||||||
|
} else if (actionVerb === "logs") {
|
||||||
|
// Display the log files
|
||||||
|
displayLogs();
|
||||||
|
// tailLogs();
|
||||||
|
} else if (actionVerb === "run" || actionVerb === "background") {
|
||||||
|
// Set up the background process
|
||||||
|
if (actionVerb === "background") {
|
||||||
|
// Start-up for the background process
|
||||||
|
process.on("SIGTERM", () => {
|
||||||
|
console.log("Stopping background process...");
|
||||||
|
removeLockFile();
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
|
process.on("exit", (code) => {
|
||||||
|
console.log(`About to exit with code: ${code}`);
|
||||||
|
// Perform cleanup or final operations here
|
||||||
|
removeLockFile();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start the main process
|
||||||
|
main();
|
||||||
|
} else {
|
||||||
|
rootHelp();
|
||||||
|
}
|
||||||
|
|
||||||
function rootHelp() {
|
function rootHelp() {
|
||||||
console.log(`Usage: ${scriptName} [run|start|stop|logs|clear] [options]`);
|
console.log(`Usage: ${scriptName} [run|start|stop|logs|clear] [options]`);
|
||||||
console.log(`\nCommands:`);
|
console.log(`\nCommands:`);
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
{
|
{
|
||||||
"name": "ngenv",
|
"name": "ngenv",
|
||||||
"version": "2.0.1",
|
"version": "2.0.0",
|
||||||
"description": "Writes ngrok tunnel url to .env file",
|
"description": "Writes ngrok tunnel url to .env file",
|
||||||
"main": "ngenv",
|
"main": "ngenv",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://git.brainwires.net/josh.guyette/ngenv"
|
|
||||||
},
|
|
||||||
"bin": {
|
"bin": {
|
||||||
"ngenv": "./ngenv"
|
"ngenv": "./ngenv"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue