(p: P)
| 15 | } |
| 16 | |
| 17 | fn hash_path<P: AsRef<Path>>(p: P) -> Result<String> { |
| 18 | // let current_dir = ::std::env::current_dir().error_chain(|| "Unable to get current directory")?; |
| 19 | let absolute_path = |
| 20 | p.as_ref().canonicalize().chain_err(|| "Unable to get absolute path to script")?; |
| 21 | Ok(hash(absolute_path.to_str().unwrap().as_bytes())) |
| 22 | } |
| 23 | |
| 24 | fn hash(data: &[u8]) -> String { |
| 25 | let mut hasher = Sha256::new(); |