Skip to content

Commit

Permalink
Hardcode dpc's proof repo on fetch all
Browse files Browse the repository at this point in the history
  • Loading branch information
dpc committed Jan 13, 2019
1 parent 4fb155c commit e2dc3f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions cargo-crev/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Display effecttive trust level on `query id trusted`
- Avoid fetching things during normal work (helps offline use)
- Add new command: `update`
- Hardcode dpc's proof-repo url on `fetch url` to help bootstrap the ecosystem

### Changed
- Windows cache folder changed from `%AppData%\Local\Dawid Ci,281,,380,arkiewicz\crev` to `%AppData%\Local\crev`.
Expand Down
12 changes: 10 additions & 2 deletions crev-lib/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,12 @@ impl Local {
pub fn fetch_all(&self) -> Result<()> {
let mut fetched_urls = HashSet::new();
let mut db = self.load_db()?;

// Temporarily hardcode `dpc`'s proof-repo url
let dpc_url = "https://github.com/dpc/crev-proofs";
self.fetch_proof_repo_import_and_print_counts(dpc_url, &mut db);
fetched_urls.insert(dpc_url.to_owned());

for entry in fs::read_dir(self.cache_remotes_path())? {
let path = entry?.path();
if !path.is_dir() {
Expand All @@ -626,8 +632,10 @@ impl Local {

match url {
Ok(url) => {
fetched_urls.insert(url.clone());
self.fetch_proof_repo_import_and_print_counts(&url, &mut db);
if !fetched_urls.contains(&url) {
fetched_urls.insert(url.clone());
self.fetch_proof_repo_import_and_print_counts(&url, &mut db);
}
}
Err(e) => {
eprintln!("ERR: {} {}", path.display(), e);
Expand Down

0 comments on commit e2dc3f8

Please sign in to comment.