#!/bin/bash BUILDDIR="/tmp/makepkg/QSyncthingTray/cmake-build" src="$HOME/utils/QSyncthingTray" echo "** QSyncthingTray updater **" cd $src git fetch --all mkdir -pv $BUILDDIR cd $BUILDDIR if [ $(pgrep '[Q]Sync') ]; then echo "[*] killing QSyncthingTray..." pkill -9 QSyncthingTray fi cmake -S$src .. cmake --build . -- -j $(nproc) cd $src mv -vf $BUILDDIR/QSyncthingTray ~/.local/bin rm -rf $BUILDDIR echo "[*] starting QSyncthingTray..." QSyncthingTray & > /dev/null 2>&1 git clean -fd --quiet