-
Notifications
You must be signed in to change notification settings - Fork 104
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
(SDK-274) Adds --version option #90
Conversation
abbf4e3
to
4b521d5
Compare
lib/pdk/util/version.rb
Outdated
end | ||
|
||
def self.pdk_ref | ||
ref = pkg_sha || git_ref |
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.
Debating flipping this prioritization. I think if someone installs the official pdk package, but modifies the underlying code (with an initialized git repo), we should be aware of 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.
In that case it would be good to know both, so maybe they should just each be conditionally added if available?
sha = ver.strip.split('.')[-1] unless ver.nil? | ||
end | ||
|
||
sha |
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.
Seems likesha
is going to be an undefined var if the version file doesn't exist?
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.
If the version file doesn't exist, I'm expecting it to return nil
so that we can fall back to git_ref
up above.
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.
Oh right, ruby hoists vars out of if/else
blocks.
To allow easy checking and reporting of the current pdk version, {{--version}} should report the installed version of PDK, as well as the vanagon build SHA from a built package or the git ref from a local git repo.