Compare commits

..

No commits in common. "master" and "rust-rewrite" have entirely different histories.

4 changed files with 4 additions and 23 deletions

2
Cargo.lock generated
View file

@ -336,7 +336,7 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "i3toolwait"
version = "0.3.0"
version = "0.1.0"
dependencies = [
"anyhow",
"byteorder",

View file

@ -1,6 +1,6 @@
[package]
name = "i3toolwait"
version = "0.3.0"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View file

@ -1,17 +0,0 @@
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

View file

@ -2,7 +2,7 @@ use std::collections::HashMap;
use std::path::PathBuf;
use std::str::FromStr;
use anyhow::{Context, Result};
use anyhow::Result;
use clap::Parser;
use log::{debug, info, warn};
use tokio::io::AsyncReadExt;
@ -167,9 +167,7 @@ async fn main() -> Result<()> {
tokio::io::stdin().read_to_string(&mut config).await?;
} else {
tokio::fs::File::open(args.config.as_ref().unwrap())
.await.with_context(
|| format!("Failed to read config file {}", args.config.as_ref().unwrap().to_string_lossy())
)?
.await?
.read_to_string(&mut config)
.await?;
}