-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add module name to the output #68
base: master
Are you sure you want to change the base?
Conversation
pkg/modulecall/parse.go
Outdated
@@ -22,7 +24,8 @@ func Parse(raw tfconfig.ModuleCall) (*Parsed, error) { | |||
if err != nil { | |||
return nil, fmt.Errorf("parse module call source: %w", err) | |||
} | |||
out := Parsed{Source: src, Raw: raw} | |||
name := src.Git.Remote[strings.LastIndex(src.Git.Remote, "/")+1:] |
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 will panic on non-git remotes
Hey! Thanks for thinking about how to improve tf-module-versions 👍 I'm not sure whether there really is a well-defined "source name" other than the source URL - it would really be the "source basename" (in the sense of unix I'm fine with adding a name, but only if we can reliably define it consistently for any module source (consider also |
Hey, thanks for the feedback. Those are good points, I should have at least checked against the examples. I think this feature makes no sense with local modules but I think now it works as you would expect. |
wrt the full name, I thought it would be useful to have the basename in the default output since the full url can get messy/long (but I do agree the information is there in the wide output, so if you don't agree this has added value, I could live with that :)) |
Added the name of the module to the tabled output.
Example output: