Skip to content

Commit

Permalink
Implemented something resembling offline mode.
Browse files Browse the repository at this point in the history
This will address rust-lang#26 once we can merge this into master, until a
`cargo` with offline mode hits stable/crates.io this branch can be used
instead.
  • Loading branch information
ibabushkin committed Jun 15, 2019
1 parent 0595417 commit 160b1aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ name = "rust-semver-public"
path = "src/bin/rust_semver_public.rs"

[dependencies]
cargo = "0.36"
cargo = { git = "https://github.com/rust-lang/cargo", branch = "master" }
crates-io = "0.24"
curl = "0.4.21"
env_logger = "0.6"
Expand Down
7 changes: 5 additions & 2 deletions src/bin/cargo_semver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn main() {
&None, // color
false, // frozen
false, // locked
// matches.opt_present("offline"),
matches.opt_present("offline"),
&None, // target_dir
&[], // unstable_flags
);
Expand Down Expand Up @@ -441,7 +441,10 @@ impl<'a> WorkInfo<'a> {

debug!("source id loaded: {:?}", source_id);

source.update()?;
if !config.offline() {
let _lock = config.acquire_package_cache_lock()?;
source.update()?;
}

Box::new(source)
};
Expand Down

0 comments on commit 160b1aa

Please sign in to comment.