Skip to content
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

(PDK-1487) Add --default-template flag to pdk convert #814

Merged
merged 1 commit into from
Dec 9, 2019

Conversation

rodjek
Copy link
Contributor

@rodjek rodjek commented Dec 9, 2019

Adds a simple flag for users to convert their module to the default
template.

pdk convert --default-template

is functionally equivalent to

pdk convert --template-url https://github.com/puppetlabs/pdk-templates

Additionally, it clears the saved template-url value so that future
operations will use the default template by default.

Adds a simple flag for users to convert their module to the default
template.

```
pdk convert --default-template
```

is functionally equivalent to

```
pdk convert --template-url https://github.com/puppetlabs/pdk-templates
```

Additionally, it clears the saved `template-url` value so that future
operations will use the default template by default.
@rodjek rodjek added this to the December 2019 milestone Dec 9, 2019
@rodjek rodjek requested a review from a team as a code owner December 9, 2019 05:18
if opts[:'default-template']
raise PDK::CLI::ExitWithError, _('You can not specify --template-url and --default-template.') if opts[:'template-url']

opts[:'template-url'] = PDK::Util::TemplateURI.default_template_addressable_uri.to_s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be resetting template-ref as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that being able to do something like pdk convert --default-template --template-ref 1.14.0 might be useful, so I left --template-ref alone. In terms of the saved ref in the answer file, it's stored as the fragment of the template-url uri, so it gets reset automatically for free.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh ok 👍

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 91.218% when pulling af1be87 on rodjek:pdk-1487 into 862314c on puppetlabs:master.

@rodjek rodjek merged commit 75aeb35 into puppetlabs:master Dec 9, 2019
@rodjek rodjek deleted the pdk-1487 branch December 9, 2019 08:59
@rodjek rodjek added the feature label Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants