test watch, split commands
This commit is contained in:
parent
6b84ecb806
commit
d146127911
3 changed files with 65 additions and 4 deletions
|
|
@ -1,9 +1,13 @@
|
|||
pkgs: cmd: pname:
|
||||
pkgs: {
|
||||
cmd,
|
||||
stop ? null,
|
||||
view ? null,
|
||||
}:
|
||||
pkgs.writeShellScriptBin "watch" ''
|
||||
while true
|
||||
do
|
||||
${cmd} &
|
||||
${cmd} ${if view == null then "" else "| ${view} "}&
|
||||
${pkgs.inotify-tools}/bin/inotifywait -e modify -r .
|
||||
pkill ${pname}
|
||||
${toString stop}
|
||||
done
|
||||
''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue