Skip to content

Commit 205a629

Browse files
environment variable fix
1 parent 03a785b commit 205a629

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "trm"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
edition = "2021"
55
authors = ["Anirudh S. Kumar <[email protected]>"]
66
description = "Temporary rm. A safer alternative to rm."

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
`trm` is a temporary `rm` command that moves files to a temporary directory instead of deleting them. This is useful when you want to delete files but are not sure if you might need them later. Note that this program is not a replacement for `rm` and should not be used as such. A conscious decision has been taken to not follow the XDG Trash specification.
44

5+
## Installation
6+
7+
The easiest way to install `trm` is to use `cargo`:
8+
9+
```
10+
cargo install trm
11+
```
12+
513

614
## Usage
715

src/trm.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ use crate::utils;
88

99

1010
pub fn get_default_dir() -> String {
11-
let user =std::env::var("USER").unwrap();
11+
let user =std::env::var("USER").unwrap_or("default".to_string());
1212
format!("/tmp/trm-{}", user)
1313
}
1414

1515
pub fn get_log_file() -> String {
16-
let user =std::env::var("USER").unwrap();
16+
let user =std::env::var("USER").unwrap_or("default".to_string());
1717
format!("/tmp/trm-{}.log", user)
1818
}
1919

0 commit comments

Comments
 (0)