Crates.io | await-modify |
lib.rs | await-modify |
version | 0.1.0 |
source | src |
created_at | 2024-07-25 14:23:29.526205 |
updated_at | 2024-07-25 14:23:29.526205 |
description | A simple tool to block until a file or directory is modified. |
homepage | |
repository | https://github.com/DanielHauge/await-modify |
max_upload_size | |
id | 1315081 |
size | 13,212 |
This repository contains a very small program that waits for a modification made to a file given as input.
This was made as a fun/learning project and as a result of lack of inotify-tools on windows.
Clone repo and build with cargo.
The program can then be put in path or alias can be made.
cargo build -r # Builds release mode
# Alias can be put in bash profile
alias await-modify='path/to/repo/target/release/await-modify' # including .exe if windows
The program will await a modification made to the input file.
await-modify <file>
Tip: it can be used to automate builds, tests or other things on file saves. Like compiling latex, markdown, unit tests etc.
# For example, in an exported function, or even hard-coded in a script file.
while true; do
await-modify "$file"
buildtex "$file" # or build code project, unit tests, etc.
done