Conversation
Co-authored-by: Chris Barber <chris@cb1inc.com>
Co-authored-by: Chris Barber <chris@cb1inc.com>
cli/commands/create.js
Outdated
|
|
||
| if (cli.argv.alloy !== undefined) { | ||
| execSync(`alloy new "${path.join(cli.argv['workspace-dir'], cli.argv.name)}"`, { stdio: 'inherit' }); | ||
| if (cli.argv.alloy !== undefined || useAlloy) { |
There was a problem hiding this comment.
I think this should be moved before the "Project created successfully".
There was a problem hiding this comment.
I think what I am trying to suggest is we have multiple sad paths and one happy path.
- If the create fails
- then show error
- exit w/ code 1
- If useAlloy
- run alloy new
- if error
- show error
- exit w/ code 1
- show success message
There was a problem hiding this comment.
trying to move it above the message "Project created successfully" but I'm having troubles with github at the moment 😞
update: looks like it worked, guess it was some caching.
There was a problem hiding this comment.
I was thinking we should process.exit(1), but now I'm wondering we should throw and let the CLI catch it and exit w/ code 1.
There was a problem hiding this comment.
I've pushed an update that will show the Project created successfully message ONLY if it's really created.
So: ti create --alloy without Alloy installed will now just show the ERROR message as you wanted to have an Alloy project and it's not "successful".
All other cases (alloy installed or creating a classic project) will show Project created successfully at the end.
cb1kenobi
left a comment
There was a problem hiding this comment.
This is perfect! Thanks for the back and forth!


fixes #14386
Add an option to create an Alloy app into the create menu:
Notes
I've added a new type
app_alloyto have it in the menu. As soon as it's selected I'll storeisAlloyto run the alloy command at the end and set the type back toappso it will use the same flow as before. In order to have less duplicated code I've created a base_app file and include that inapp_alloyandapp.Test:
ti create