- Notifications
You must be signed in to change notification settings - Fork2
a simple auto reload (live reload) utility
License
makiuchi-d/arelo
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Arelo executes the specified command and monitors the files under the target directory.When the file that matches the pattern has been modified, restart the command.
- Simple command line interface without config file
- Monitoring file patterns are specified as glob
- globstar (**; matches to zero or more directories) supported
- can match the no extention filename
- can match the hidden filename which starts with "."
- Safely terminate child processes
- Any command line tool can be executed
- not only go project
- can execute shell script
- No unnesesary servers
- no need to use local port unlike http server
go install github.com/makiuchi-d/arelo@latest
Alternatively, you can install it viaHomebrew:
brew install arelo
Or, you can download the executable binaries from therelease page.
To get a static-linked executable binary, build withCGO_ENABLED=0
.
Run this command in your Go project directory.
arelo -p '**/*.go' -i '**/.*' -i '**/*_test.go' -- go run .
Usage: arelo [OPTION]... -- COMMANDRun the COMMAND and restart when a file matches the pattern has been modified.Options: -d, --delay duration duration to delay the restart of the command (default 1s) -f, --filter event filter file system event (CREATE|WRITE|REMOVE|RENAME|CHMOD) -h, --help display this message -i, --ignore glob ignore pathname glob pattern -n, --no-stdin do not forward stdin to the command -p, --pattern glob trigger pathname glob pattern (default "**") --polling interval poll files at given interval instead of using fsnotify -r, --restart restart the command on exit -s, --signal signal signal used to stop the command (default "SIGTERM") -t, --target path observation target path (default "./") -v, --verbose verbose output -V, --version display version
Monitor file modifications under thepath
directory.The subdirectories are also monitored unless they match to the ignore patterns.
This option can be set multiple times.
The default value is the current directory ("./").
Note:This option can be file instead of directory,but arelo cannot follow modification after the file has been removed/renamed.
Restart command when the modified file is matched to this pattern.
The pattern is specified as an extended globthat supports{alt1,...}
,**
like zsh or bash with globstar option.And note that the path delimiter is/
even on Windows.
This option can set multiple times.
The default value ("**") is a pattern that matches any file in the target directories and their subdirectories.
Ignore the file or directory whose names is matched to this pattern.
This option takes precedence over the --pattern option.
This option can set multiple times.
Filter the filesystem event to ignore it.
The event can beCREATE
,WRITE
,REMOVE
,RENAME
orCHMOD
.
This option can set multiple times.
Delay the restart of the command from the detection of the pattern matched file modification.The detections within the delay are ignored.
The duration is specified as a number with a unit suffix ("ns", "us" (or "µs"), "ms", "s", "m", "h").
This signal will be sent to stop the command on restart.The default signal isSIGTERM
.
This option can beSIGHUP
,SIGINT
,SIGQUIT
,SIGKILL
,SIGUSR1
,SIGUSR2
,SIGWINCH
orSIGTERM
.
This option is not available on Windows.
Automatically restart the command when it exits, similar to when the pattern matched file is modified.
Poll files at the specified interval instead of using fsnotify.If not set or set to0
, fsnotify is used for file monitoring.
This option is useful when fsnotify cannot detect changes, such as on WSL2.
The interval is specified as a number with a unit suffix ("ns", "us" (or "µs"), "ms", "s", "m", "h").
Output logs verbosely.
Print version informatin.
Print usage.
arelo -t ./src -t ./html -p '**/*.{go,html,yaml}' -i '**/.*' -- go run .
Monitor files under the ./src or ./html directories.
Restart command when any *.go, *.html, *.yml file under the target, sub, and subsub... directories modified.
Ignore files/directories whose name starts with '.'.
Command to run.
About
a simple auto reload (live reload) utility