A command-line tool for command execution when files or directories change
go
Go to file
Serghei e75cc120cc fix content 2023-12-05 19:33:58 +01:00
cmd/wandel restructuring 2023-11-11 21:40:00 +01:00
internal full-mute flag 2023-12-05 19:31:47 +01:00
LICENSE better LICENSE formattin 2023-11-12 12:32:55 +01:00
README.md fix content 2023-12-05 19:33:58 +01:00
go.mod added logo 2023-11-11 11:25:50 +01:00
go.sum added logo 2023-11-11 11:25:50 +01:00

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.

License

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