feat: better time display and tmpdir expands homedir
This commit is contained in:
parent
5c15c3e075
commit
fc3ae1e71a
3 changed files with 5 additions and 1 deletions
|
@ -23,3 +23,5 @@ serde = { version = "1.0.171", features = ["derive"] }
|
|||
libc = "0.2.80"
|
||||
reqwest = { version = "0.11.18", features = ["blocking"] }
|
||||
tar = "0.4.39"
|
||||
humantime = "2.1.0"
|
||||
expanduser = "1.2.2"
|
||||
|
|
|
@ -94,7 +94,7 @@ impl Command {
|
|||
let duration = end.duration_since(start);
|
||||
|
||||
info!("Install complete.");
|
||||
info!("Install took {}ms.", duration.as_nanos() as f64 / 1000000.0);
|
||||
info!("Install took {}.", humantime::format_duration(duration));
|
||||
}
|
||||
Command::Remove {
|
||||
package_identifier,
|
||||
|
|
|
@ -8,6 +8,8 @@ pub struct TempDir {
|
|||
|
||||
impl TempDir {
|
||||
pub fn new(path: PathBuf) -> TempDir {
|
||||
let pbs: String = path.to_str().unwrap().into();
|
||||
let path = expanduser::expanduser(&pbs).unwrap();
|
||||
if !path.exists() {
|
||||
std::fs::create_dir_all(&path).unwrap();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue