11 lines
187 B
Nix
11 lines
187 B
Nix
pkgs: cmd: pname:
|
|
pkgs.writeShellScriptBin "watch" ''
|
|
while true
|
|
do
|
|
${cmd} &
|
|
${pkgs.inotify-tools}/bin/inotifywait -e modify -r . --exclude .git
|
|
pkill ${pname}
|
|
done
|
|
''
|
|
|