Crates.io | refrsh |
lib.rs | refrsh |
version | 0.2.1 |
source | src |
created_at | 2023-09-05 12:39:27.939643 |
updated_at | 2023-09-05 14:21:21.946603 |
description | A Simple Hot Reload Application for your apps |
homepage | |
repository | https://github.com/newtoallofthis123/refresh |
max_upload_size | |
id | 964237 |
size | 40,784 |
A Simple and easy to use auto builder tool for your projects.
refrsh is a very simple cli written in rust that does one thing and one thing only: Auto Build your project when any file changes.
Atleast by default it does that. I am planning to add more features to it in the future. For now, you can use refrsh on your:
Other than that, you can free to contribute and add support for your own language or toolchain.
For now, using refrsh is very simple. Just install it using cargo:
cargo install refrsh
And then run it in your project directory:
refrsh <dir>
Where <dir>
is the directory you want to watch for changes. If you don't specify a directory, it will watch the current directory.
refrsh uses the notify crate to watch for changes in the specified directory.
refrsh automatically picks up on which tool chain and language you are using and runs the appropriate command to build your project.
For example, if you are using rust, refrsh will run cargo build
on your project. If you are using go, refrsh will run go build
on your project.
However, if just run refrsh
in a directory, if refrsh doesn't find an appropriate command to run, it will just exit.
If you want to add support for your own language or toolchain, you can do so by modifying the src/handler.rs
file.
For example, the rust handler looks like this:
fn handle_cargo(){
bunt::println!("Building...");
let _ = std::process::Command::new("cargo")
.arg("build")
.output()
.expect("Failed to build");
bunt::println!("{$green}Build Successful{/$}");
}
You can add your own handler in the same way. Just add a new function and call it in the handle
function.
If you want to add support for a new language, you can do so by adding a new function in the same way.
Well, there is more to it and I will add more documentation in the future. For now, you can just look at the source code and figure it out.
refrsh is licensed under the MIT License. See the LICENSE file for more information.