pmeunier / carnix

Faster nix-prefetch-git when on the path

By blabla on March 27, 2019
signed by pmeunier.
8c4n8BfXUBtEPqU82DfVdxifRBFjaxRyc5DkCLMXUezFutqggauJvWxz5hvG1CVH6pQsHEqCcgmPNUdqbYEZtMzy
This patch is in the following branches:
master
196
197

198
199



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
        println!("Prefetching {} ({})", self.name, cached_url);
        debug!("cached_url = {:?}", cached_url);
        let prefetch = Command::new("nix-shell")
        let prefetch = Command::new("nix-prefetch-git")
            .args(&[
                "-p", "nix-prefetch-git",
                "--run",
                &format!("nix-prefetch-git --url {} --rev {}", url, rev)
                "--url", url,
                "--rev", rev,
            ])
            .output();
        let prefetch = match prefetch {
            Ok(p) => Ok(p),
            Err(_) => {
                Command::new("nix-shell")
                    .args(&[
                        "-p", "nix-prefetch-git",
                        "--run",
                        &format!("nix-prefetch-git --url {} --rev {}", url, rev)
                    ])
                    .output()
            }
        };