1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-21 19:11:30 +01:00

zsh: watch_file: exit when input file does not exist

This commit is contained in:
bretello 2024-07-28 14:36:31 +02:00
parent 0be5c5f39e
commit 101e4fe00c
Signed by: brethil
GPG Key ID: 876AAC6290170FE7

View File

@ -316,6 +316,10 @@ function watch_file() {
{
set +m # disable job control messages
while true; do
if [[ ! -f "$file" ]]; then
echo "File \"$file\" does not exist";
break
fi
zsh -c "$action" &
_bg_job_pid=$!
disown