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

Fix template not used for help command #665

Merged

Conversation

dev-drprasad
Copy link
Contributor

What does this change

Fix custom templates not used for commands and little refactor

Ouput of porter help:

I am porter πŸ‘©πŸ½β€βœˆοΈ, the friendly neighborhood CNAB authoring tool

Usage:
  porter [command]

Examples:
  porter create
  porter build
  porter install
  porter uninstall

Resources:
  bundles     Bundle commands
  credentials Credentials commands
  instances   Bundle Instance commands
  mixins      Mixin commands

Aliased Commands:
  archive     Archive a bundle
  build       Build a bundle
  create      Create a bundle
  explain     Explain a bundle
  install     Install a new instance of a bundle
  invoke      Invoke a custom action on a bundle instance
  list        list instances of installed bundles
  publish     Publish a bundle
  show        Show an instance of a bundle
  uninstall   Uninstall a bundle instance
  upgrade     Upgrade a bundle instance

Meta Commands:
  docs        Generate markdown docs
  schema      Print the JSON schema for the Porter manifest
  version     Print the application version

Flags:
      --debug   Enable debug logging
  -h, --help    help for porter

Use "porter [command] --help" for more information about a command.

What issue does it fix

Closes #656

Notes for the reviewer

Renamed helptext directory to templates. It made sense to me

Checklist

  • Unit Tests
  • Documentation
    • Documentation Not Impacted

@dev-drprasad dev-drprasad force-pushed the fix-template-not-used-help-command branch from 220a54d to 1b183bc Compare September 28, 2019 16:12
@carolynvs carolynvs self-assigned this Sep 30, 2019
@@ -1,3 +1,5 @@
//go:generate packr2
Copy link
Member

Choose a reason for hiding this comment

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

This is what was missing and causing things to not work properly for binaries not build on dev machines. Thanks for figuring that out! πŸ‘

It can be hard to tell because packr will fallback to the filesystem when the data isn't found in the binary. Because this line was missing, nothing was being built into the binary for the help text. But it was working on dev machines because the files were present locally. πŸ˜†

The other changes in the file aren't necessary and should be reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other changes are intentional.
I thought directory name: templates makes sense than helptext because in future we may need to add other templates. So, i refactored that logic

If i am wrong/misunderstood , i can revert if you want

Copy link
Member

Choose a reason for hiding this comment

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

Our preference for pull requests, is it limit them to a single task. In this case the issue is to fix the help text and since the refactoring wasn't necessary for the fix, we prefer to not include it in the same PR.

Later, if we had an issue where we needed to add more templates to cmd/porter, that would be the time to refactor. Right now we don't have anything like that on the backlog though.

Copy link
Member

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@carolynvs carolynvs merged commit ea48248 into getporter:master Oct 1, 2019
@dev-drprasad dev-drprasad deleted the fix-template-not-used-help-command branch October 2, 2019 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom help template not used for published version of porter
2 participants