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
(hack) Add bolt module show <module>
command
#2938
Conversation
8c0a9c0
to
7c8fe29
Compare
7c8fe29
to
3f9ba70
Compare
lib/bolt/pal.rb
Outdated
mod = Puppet.lookup(:current_environment).module(name.split(%r{[/-]}, 2).last) | ||
|
||
unless mod && (mod.forge_name == name || mod.name == name) | ||
raise Bolt::Error.new("Unknown module #{name}", 'bolt/unknown-module') |
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.
raise Bolt::Error.new("Unknown module #{name}", 'bolt/unknown-module') | |
raise Bolt::Error.new("Could not find #{name} on the modulepath. Use #{command} to install the module.", 'bolt/unknown-module') |
Or something. I'm not sure users will know that this data comes from the modules on the modulepath and not the Forge, so mostly just want to clarify that.
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.
Updated. Left out the command suggestion since you can use a short module name (e.g. no author in the name), which doesn't work with the module add
command.
3f9ba70
to
fb71d07
Compare
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.
- Errors if the module doesn't exist
- Accepts
<namespace>/<module_name>
syntax - Accepts
<namespace>-<module_name>
syntax - Accepts
<module_name>
- Formats as JSON with the JSON outputter
- Formats a module with no metadata
- Shows the first module on the path (modules are shadowed)
- Gets module data locally, not from Forge
- Handles invalid JSON in
metadata.json
- Has a nice message when a module exists on the Forge, but not the modulepath
- Shows a module that doesn't have plans or tasks
- Shows a project
- Includes powershell cmdlet
- Works when not inside a Bolt project
- Does not list private tasks and plans
I don't think there's a lot we can do to make this better and it doesn't seem that bad, but the invalid metadata output is definitely a little odd:
lucy ~/githubs/bolt ((7c8fe299...)) $ be bolt module show mymodule
mymodule has an invalid and unparsable metadata.json file. The parse error: 783: unexpected token at '{
"invalid"
}
'
mymodule has an invalid and unparsable metadata.json file. The parse error: 783: unexpected token at '{
"invalid"
}
'
mymodule has an invalid and unparsable metadata.json file. The parse error: 783: unexpected token at '{
"invalid"
}
'
This adds a new `bolt module show <module>` command that shows detailed information for a module. It lists the module's name, version, summary, available plans and tasks, operating system support, and dependencies. !feature * **Show detailed module information** Bolt now supports showing detailed information about a module using the `bolt module show <module>` command and `Get-BoltModule -Name <module>` PowerShell cmdlet.
fb71d07
to
7221bba
Compare
This adds a new
bolt module show <module>
command that shows detailedinformation for a module. It lists the module's name, version, summary,
available plans and tasks, operating system support, and dependencies.
!feature
Show detailed module information
Bolt now supports showing detailed information about a module using
the
bolt module show <module>
command andGet-BoltModule -Name <module>
PowerShell cmdlet.