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
Corrects Binlink in Studio, adds HAB_BINLINK_DIR envvar #2951
Conversation
Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
f8ab2d2
to
08beb8f
Compare
Fixes #975 |
Can you tell me what is the default value, so if this environment variable is not set? |
@ShalokShalom the default location doesnt change with this PR. Basically https://github.com/habitat-sh/habitat/pull/2951/files#diff-aa992c32664dad8d8e1a241ef1d50bcfR18 we default to |
Its a bit more flexible and safe way to implement the other PR. |
08beb8f
to
067e90b
Compare
components/hab/src/main.rs
Outdated
@@ -287,7 +287,8 @@ fn sub_origin_key_upload(ui: &mut UI, m: &ArgMatches) -> Result<()> { | |||
|
|||
fn sub_pkg_binlink(ui: &mut UI, m: &ArgMatches) -> Result<()> { | |||
let ident = PackageIdent::from_str(m.value_of("PKG_IDENT").unwrap())?; | |||
let dest_dir = Path::new(m.value_of("DEST_DIR").unwrap_or(DEFAULT_BINLINK_DIR)); | |||
let env_or_default = henv::var(BINLINK_DIR_ENVVAR).unwrap_or(DEFAULT_BINLINK_DIR.to_string()); |
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.
Should you call the function you created above? default_binlink_dir
which appears to be unused right now.
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.
We definitely can. I added that in case it was useful elsewhere. The syntax here was just to match the way we're handling other ENVVAR stuff for the depot bits within the same script
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.
since its basically doing the same thing as that function, I'd either use it or drop the function
components/hab/src/main.rs
Outdated
@@ -454,7 +455,9 @@ fn sub_pkg_install(ui: &mut UI, m: &ArgMatches) -> Result<()> { | |||
ignore_target, | |||
)?; | |||
if m.is_present("BINLINK") { | |||
let dest_dir = Path::new(m.value_of("DEST_DIR").unwrap_or(DEFAULT_BINLINK_DIR)); | |||
let env_or_default = | |||
henv::var(BINLINK_DIR_ENVVAR).unwrap_or(DEFAULT_BINLINK_DIR.to_string()); |
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.
same comment as above
Signed-off-by: Ian Henry <ihenry@chef.io>
067e90b
to
7d68c4e
Compare
@thesentinels approve |
🤘 I am testing your branch against master before merging it. We do this to ensure that the master branch is never failing tests. |
Travis CI has started testing this PR. |
💖 Travis CI reports this PR passed. It always makes me feel nice when humans approve of one anothers work. I'm merging this PR now. I just want you and the contributor to answer me one question: |
Signed-off-by: Ian Henry ihenry@chef.io