Compare commits
37 commits
rust-rewri
...
master
Author | SHA1 | Date | |
---|---|---|---|
56c497b5dd | |||
599a4dfac0 | |||
4c0bcac50b | |||
690777aa16 | |||
d3d4530cfd | |||
4e1e241bf1 | |||
7b8c6df478 | |||
015849345d | |||
8763d8a382 | |||
74e98f7e3b | |||
ddabe282a4 | |||
8b7e6ae7ba | |||
be97b30e86 | |||
4180e3b427 | |||
932a36517b | |||
092a4bccfe | |||
ef8bf677ae | |||
e127cdde6a | |||
fd777c2683 | |||
794b032cca | |||
ba5d560a01 | |||
6f49d819ac | |||
c10b9fdb66 | |||
9f4853485d | |||
53f8ca5eec | |||
6e10cd4e41 | |||
05dda652db | |||
e1beb78bfe | |||
6f4d9032b4 | |||
1d2623ec66 | |||
089fc6fe22 | |||
ec8bb73d1c | |||
ec8fd5171f | |||
459de18a9c | |||
c38d3eb577 | |||
2377c2eb4c | |||
75087e5fdb |
4 changed files with 23 additions and 4 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -336,7 +336,7 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
|||
|
||||
[[package]]
|
||||
name = "i3toolwait"
|
||||
version = "0.1.0"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"byteorder",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "i3toolwait"
|
||||
version = "0.1.0"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
|
17
Makefile
Normal file
17
Makefile
Normal file
|
@ -0,0 +1,17 @@
|
|||
EXEC := i3toolwait
|
||||
INSTALL_BASE ?= /usr/local
|
||||
|
||||
default: target/debug/${EXEC}
|
||||
release: target/release/${EXEC}
|
||||
default: target/debug/${EXEC}
|
||||
|
||||
install: target/release/${EXEC}
|
||||
install -Dm0755 -oroot -groot $< ${INSTALL_BASE}/bin/${EXEC}
|
||||
|
||||
target/release/${EXEC}:
|
||||
@cargo build --release
|
||||
|
||||
target/debug/${EXEC}:
|
||||
@cargo build
|
||||
|
||||
.PHONY: install
|
|
@ -2,7 +2,7 @@ use std::collections::HashMap;
|
|||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
use anyhow::Result;
|
||||
use anyhow::{Context, Result};
|
||||
use clap::Parser;
|
||||
use log::{debug, info, warn};
|
||||
use tokio::io::AsyncReadExt;
|
||||
|
@ -167,7 +167,9 @@ async fn main() -> Result<()> {
|
|||
tokio::io::stdin().read_to_string(&mut config).await?;
|
||||
} else {
|
||||
tokio::fs::File::open(args.config.as_ref().unwrap())
|
||||
.await?
|
||||
.await.with_context(
|
||||
|| format!("Failed to read config file {}", args.config.as_ref().unwrap().to_string_lossy())
|
||||
)?
|
||||
.read_to_string(&mut config)
|
||||
.await?;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue