Add script to setup supervise symlinks

This commit is contained in:
crater2150 2023-08-20 17:23:35 +02:00
parent 2de8087c3e
commit 3a5dc24f75

18
setup-supervise.zsh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/zsh
for i in *(/); do
if [[ -h ${i:a}/supervise ]]; then continue
elif [[ -d ${i:a}/supervise ]]; then
echo "Warning: ${i:a}/supervise is a directory, not a symlink"
else
echo creating ${i:a}/supervise
ln -s ${XDG_RUNTIME_DIR:-/run/user/$UID}/supervise.${i:t} ${i:a}/supervise
fi
done
for i in */log(/); do
if [[ -h ${i:a}/supervise ]]; then continue
elif [[ -d ${i:a}/supervise ]]; then
echo "Warning: ${i:a}/supervise is a directory, not a symlink"
else
ln -s ${XDG_RUNTIME_DIR:-/run/user/$UID}/supervise.${i:h:t}-log ${i:a}/supervise
fi
done