Skip to content

romancitodev/fws-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fws-rs

fws-rs is an application written in rust that acts as a configurable file watcher, capable of detecting real-time changes and running custom commands. Configuration can be done via a JSON file or as arguments during runtime.

⭐ Features

  • Watch for file system changes (create, modify, delete)
  • Execute custom commands
  • Configuration via JSON file or command line arguments
  • Recursive directory watching
  • Observe custom files with patterns extensions

🚀 Getting started

📥 Installation

Clone the repo or download the most recently release from github.

git clone https://github.com/ChirujanoCodding/fws-rs.git

👷‍♂️ Building the project

In the folder fws-rs run:

cargo build --release

📚 Usage & Examples

Once you have the program builded or downloaded from the most recently release, insert the fws-rs.exe or fws-rs (depends your OS) in your project.

  1. Using a configuration file:
fws-rs --config "config.json"

(You must need to create a config.json file like this)

{
    "watch": "your/path", // the path you want to observe.
    "exec": "python main.py", // the command you want to be execute when apply changes on files.
    "recursive": true | false // if you want to look specific path or recursive (default False).
    "on_events_only": true, // if you want to execute commands only if ocurrs an event (default False).
    "patterns": ['.rs', '.py', '.js'] // your .extensions (default is []).
}
  1. Using configuration arguments:
fws-rs --watch "your/path" --exec "your script"

📷 Screenshots

Executing with different configs

image

image

Different logs:

image

💼 License

This project is under the MIT License.