-
Notifications
You must be signed in to change notification settings - Fork 0
feat(cli): simplify nova startup commands #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,13 +2,18 @@ | |
|
|
||
| const args = process.argv.slice(2); | ||
|
|
||
| if (args.includes("--activate")) { | ||
| const reportError = (err) => { | ||
| console.error("\n ✗ " + err.message + "\n"); | ||
| process.exitCode = 1; | ||
| }; | ||
|
|
||
| if (args.length === 0) { | ||
| const { activate } = await import("../src/index.js"); | ||
| await activate().catch((err) => { | ||
| console.error("\n ✗ " + err.message + "\n"); | ||
| process.exit(1); | ||
| }); | ||
| await activate().catch(reportError); | ||
| } else if (args.length === 1 && args[0] === "--dev") { | ||
| const { devMode } = await import("../.development/index.js"); | ||
| await devMode().catch(reportError); | ||
|
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win Handle import failures in the 🤖 Prompt for AI Agents |
||
| } else { | ||
| console.log("\n Usage: nova --activate\n"); | ||
| process.exit(0); | ||
| console.error("\n Usage: nova [--dev]\n"); | ||
| process.exitCode = 1; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: thatonevikash/nova
Length of output: 2346
Catch dynamic import failures in
reportError.If
import("../src/index.js")fails, the rejection occurs beforeactivate().catch(reportError)is created. Wrap the import and invocation in onetry/catchso both failures usereportError.🤖 Prompt for AI Agents