-
Notifications
You must be signed in to change notification settings - Fork 51
feat(cli): git repository support for custom init templates #820
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #820 +/- ##
==========================================
+ Coverage 82.76% 82.88% +0.12%
==========================================
Files 71 71
Lines 10396 10519 +123
Branches 1295 1320 +25
==========================================
+ Hits 8604 8719 +115
- Misses 1753 1762 +9
+ Partials 39 38 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Probably will need to wait until #819 is merged.
| 'from-git-url': { type: 'string', desc: 'Git repository URL to clone custom template from', requiresArg: true, conflicts: ['lib-version', 'from-path'] }, | ||
| 'template-path': { type: 'string', desc: 'Path to a specific template within a multi-template repository', requiresArg: true }, | ||
| }, | ||
| implies: { 'template-path': 'from-path' }, |
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.
This should be replaced by a check that ensures that from-path or from-git-url was also used.
|
|
||
| // Validate that if template-path is provided, exactly one custom template source must be provided | ||
| if (options.templatePath && !options.fromPath && !options.fromGitUrl) { | ||
| throw new ToolkitError('--template-path can only be used with --from-path or --from-git-url'); |
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.
why not use a check in yargs instead? In general, try to catch problems as early as you can.
9b3ea2d to
5437650
Compare
3c79410 to
0a7ce7b
Compare
0a7ce7b to
657aaf0
Compare
Rohan:
Added additional tests and implemented changes I had requested. There were 40 commits before, and many merge conflicts from #819.
Unit test coverage for
init.tsis now 97.65%. Tested by hand for many cases as well.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license