-
-
Notifications
You must be signed in to change notification settings - Fork 18
fix(publish): Only allow valid target ids for -t #137
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
Conversation
With this patch, only targets defined in `.craft.yml` are accepted in the `-t` flag, also fixing #136. ```shell craft publish --help i info craft 0.13.2 dist publish NEW-VERSION � Publish artifacts Positionals: NEW-VERSION Version to publish [string] [required] Options: --no-input Suppresses all user prompts [boolean] [default: false] --dry-run Dry run mode: do not perform any real actions [boolean] [default: false] --target, -t Publish to this target [string] [choices: "npm", "gh-pages", "gcs", "registry", "github", "release[docker]", "latest[docker]", "all", "none"] [default: "all"] --rev, -r Source revision (git SHA or tag) to publish (if not release branch head) [string] --no-merge Do not merge the release branch after publishing [boolean] [default: false] --keep-branch Do not remove release branch after merging it [boolean] [default: false] --keep-downloads Keep all downloaded files [boolean] [default: false] --no-status-check Do not check for build status [boolean] [default: false] -v, --version Show version number [boolean] -h, --help Show help [boolean] ```
src/targets/index.ts
Outdated
|
|
||
| export function getTargetId(target: TargetConfig): string { | ||
| return target.id | ||
| ? `${target.id}[${target.name}]` |
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.
For me personally it would be more intuitive to swap id and name, so we e.g. have docker as the generic target, and docker[release] or docker#release as more specific one.
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.
I agree and first I thought this would be a breaking change but it won't. I'll make that change and then merge.
Thanks for the feedback!
With this patch, only targets defined in
.craft.ymlare acceptedin the
-tflag, also fixing #136.craft publish --help i info craft 0.13.2 dist publish NEW-VERSION 🛫 Publish artifacts Positionals: NEW-VERSION Version to publish [string] [required] Options: --no-input Suppresses all user prompts [boolean] [default: false] --dry-run Dry run mode: do not perform any real actions [boolean] [default: false] --target, -t Publish to this target [string] [choices: "npm", "gh-pages", "gcs", "registry", "github", "docker[release]", "docker[latest]", "all", "none"] [default: "all"] --rev, -r Source revision (git SHA or tag) to publish (if not release branch head) [string] --no-merge Do not merge the release branch after publishing [boolean] [default: false] --keep-branch Do not remove release branch after merging it [boolean] [default: false] --keep-downloads Keep all downloaded files [boolean] [default: false] --no-status-check Do not check for build status [boolean] [default: false] -v, --version Show version number [boolean] -h, --help Show help [boolean]