![]() |
||
---|---|---|
cmd/wandel | ||
internal | ||
LICENSE | ||
README.md | ||
go.mod | ||
go.sum |
README.md
Wandel
Wandel [ˈvandl̩] is a command-line tool that executes a command when the content/s of given files or directories change/s.
Content
Installation
With go
go install codeberg.org/serghei/wandel/cmd/wandel@latest
Usage
Wandel requires at least one argument. That should be a file or a directory.
The following command listens to all file and directory changes in the current directory:
wandel .
Without flags, this will only print when the content in the directory changes and prints out the affected path.
You can also listen to multiple files and directories:
wandel index.html index.js
Flags
You can use flags to execute one or more commands when the content of the files or directories changes.
All the flags are usable together.
String Flags
cmd
Runs the passed command every time the files or directories change. When passing multiple files or directories, use quotation marks.
wandel index.html -cmd "npm run build"
# or
wandel index.html -c "npm run build"
ignore
Ignore the passed files or directories. When the content of them changes, Wandel won't react.
wandel . -ignore dist
# or
wandel . -i dist
When passing multiple files or directories, use quotation marks.
wandel . -ignore "dist doc"
# or
wandel . -i "dist doc"
start
Runs the given command once when executing Wandel.
wandel . -start "echo Visit on http://localhost:8080"
# or
wandel . -s "echo Visit on http://localhost:8080"
Boolean Flags
run
Executes the command immediately without waiting for a file or directory to be changed.
wandel src -c "npm run build" -run
# or
wandel src -c "npm run build" -r
mute
Mute the output of Wandel. Only prints the output of the command passed to the -cmd
-flag.
wandel src -c "npm run build" -mute
# or
wandel src -c "npm run build" -m
full-mute
Mute the output of Wandel except for errors.
wandel src -c "npm run build" -full-mute
# or
wandel src -c "npm run build" -f
once
Executes the command once and then terminates Wandel.
wandel src -c "npm run build" -once
# or
wandel src -c "npm run build" -o