Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Cargo install #5

Open
dvdsk opened this issue Apr 29, 2022 · 0 comments
Open

Support Cargo install #5

dvdsk opened this issue Apr 29, 2022 · 0 comments

Comments

@dvdsk
Copy link
Contributor

dvdsk commented Apr 29, 2022

This would replace:

git clone https://github.com/danieldg/rwaybar
cd rwaybar
cargo build --release
cp target/release/rwaybar <somewhere>
cp doc/rwaybar.toml ~/.config/
$EDITOR ~/.config/rwaybar.toml

with:

cargo install rwaybar
rwaybar  # generates example config if it does not find a config
$EDITOR ~/.config/rwaybar.toml
  • To support cargo install rwaybar needs to be published on crates.io
  • Since we do not clone the repo anymore rwaybar needs to generate the config. A simple const CONFIG: &str = include_str!(doc/rwaybar.toml) combined with a fs::write_all(config_path, CONFIG.as_bytes()) when the config is not found should do the trick.

----------------------- Edit ----------------------
I just realize I can also use cargo install --git https://github.com/danieldg/rwaybar. However I still think it would still be nice to have this on crates.io.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant