Usage:
cargo <command> [<args>...]
- cargo -h | --help
- cargo -V | --version
- cargo --list
+ cargo [options]
Options:
-h, --help Display this message
let root = pkg.get_manifest_path().dir_path();
Ok(candidates.move_iter().filter(|candidate| {
let candidate = candidate.path_relative_from(&root).unwrap();
- !pats.iter().any(|p| p.matches_path(&candidate))
+ !pats.iter().any(|p| p.matches_path(&candidate)) &&
+ candidate.is_file()
}).collect())
}
fn list_files_git(&self, pkg: &Package) -> CargoResult<Vec<Path>> {
let cwd = pkg.get_manifest_path().dir_path();
let mut cmd = process("git").cwd(cwd.clone());
- cmd = cmd.arg("ls-files").arg("-z");
+ cmd = cmd.arg("ls-files").arg("-z")
+ .arg("-x").arg("/target")
+ .arg("-x").arg("/Cargo.lock");
// Filter out all other packages with a filter directive
for pkg in self.packages.iter().filter(|p| *p != pkg) {
// as 0.
max = cmp::max(max, file.stat().map(|s| s.modified).unwrap_or(0));
}
+ log!(5, "fingerprint {}: {}", self.path.display(), max);
Ok(max.to_string())
}
}
let hour = 1000 * 3600;
let newtime = stat.modified - hour;
+
+ // Sadly change_file_times has the same failure mode as the above
+ // rmdir_recursive :(
+ match fs::change_file_times(path, newtime, newtime) {
+ Err(io::IoError { kind: io::PermissionDenied, .. }) => {}
+ e => return e,
+ }
+ try!(fs::chmod(path, stat.perm | io::UserWrite));
fs::change_file_times(path, newtime, newtime)
}
}
let proj = project("list-runs");
let pr = copied_executable_process(&proj, "cargo", &Path::new("bin"));
let new_path = os::join_paths(new_path().as_slice()).unwrap();
- assert_that(pr.arg("--list").env("PATH", Some(new_path.as_slice())),
+ assert_that(pr.arg("-v").arg("--list").env("PATH", Some(new_path.as_slice())),
execs().with_status(0)
.with_stdout("Installed Commands:\n"));
})
let mut path = new_path();
path.push(proj.root().join("path-test"));
let path = os::join_paths(path.as_slice()).unwrap();
- assert_that(pr.arg("--list").env("PATH", Some(path.as_slice())),
+ assert_that(pr.arg("-v").arg("--list").env("PATH", Some(path.as_slice())),
execs().with_status(0)
.with_stdout("Installed Commands:\n 1\n 2\n 3\n"));
})
.file("src/lib.rs", "pub fn bar() -> int { 1 }")
.file(".gitignore", "
src/bar.rs
- Cargo.lock
")
}).assert();
foo.root().move_into_the_past().assert();
+ timer::sleep(Duration::milliseconds(1000));
+
assert_that(foo.process(cargo_dir().join("cargo-build")),
execs().with_status(0)
.with_stdout(format!("\