Skip to content

Commit 7b329bf

Browse files
committed
Get home path from $HOME
this _could_ use the home crate (as suggested in rust-lang/libs-team#372) but theres no reason to attempt to be cross-platform; this depends on so many mac things anyway
1 parent 8355654 commit 7b329bf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,14 @@ fn do_update(status: &Status) {
188188
}
189189
}
190190

191+
fn pomo_sock_path() -> Result<String, std::env::VarError> {
192+
let home = std::env::var("HOME")?;
193+
194+
Ok(String::from(home) + "/.pomo/publish.sock")
195+
}
196+
191197
fn main() -> std::io::Result<()> {
192-
let listener = UnixListener::bind("/Users/amiel/.pomo/publish.sock")?;
198+
let listener = UnixListener::bind(pomo_sock_path().expect("Could not get $HOME"))?;
193199

194200
let mut current_status = Status::default();
195201

0 commit comments

Comments
 (0)