-
Notifications
You must be signed in to change notification settings - Fork 8
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
Initial implementation of fh fetch
#160
Conversation
src/cli/cmd/fetch.rs
Outdated
token_path: String, | ||
out: Option<&str>, | ||
) -> Result<()> { | ||
match out { |
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.
Small nit, but I think we generally prefer the if let Some(out) { ... } else { ... }
idiom around these parts
Co-authored-by: Cole Helbling <[email protected]>
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.
LGTM, tested it on this repo and it works fine:
vin@scadrial ~/w/d/fh (fh-fetch-command) 2.2s> cargo r -- fetch DeterminateSystems/fh/0#packages.x86_64-linux.default ./test
Compiling fh v0.1.21 (/home/vin/workspace/detsys/fh)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.37s
Running `target/debug/fh fetch 'DeterminateSystems/fh/0#packages.x86_64-linux.default' ./test`
INFO execute: Resolved DeterminateSystems/fh/0#packages.x86_64-linux.default to /nix/store/4fr2l65x6hkvzpy0xxc9i7v5hq606wh7-fh-20241206-47747e4-0.1.21
INFO execute: Copied /nix/store/4fr2l65x6hkvzpy0xxc9i7v5hq606wh7-fh-20241206-47747e4-0.1.21 to ./test
This PR is an initial implementation of
fh fetch
. Users can request an out link with--out-link
. This is supported natively in nix 2.26, so on lower versions we manually create a symbolic link.