| 1234567891011121314151617181920212223242526 |
- #!/bin/zsh
- ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
- # compile.sh
- #
- # This script is made to be called by yabai when browser is launched - see
- # `yabairc` for details. This often causes the process to fire twice, so the
- # program requires a lock. Detailed compilation logs are also kept.
- ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
- cd $XDG_CONFIG_HOME/surfingkeys/ &&
- if mkdir compile.lock 2>/dev/null; then
- echo "=== === === === === === === === === === ===" | tee -a compile.log
- echo " STARTED " | tee -a compile.log
- echo "=== === === === === === === === === === ===" | tee -a compile.log
- echo "$(date 2>&1): Compiling" | tee -a compile.log
- if [ ! -f package-lock.json ]; then
- echo "\t$(npm install 2>&1)" | tee -a compile.log
- fi
- echo "\t$(npm run build 2>&1)" | tee -a compile.log
- rm -rf compile.lock
- echo "=== === === === === === === === === === ===" | tee -a compile.log
- echo " FINISHED " | tee -a compile.log
- echo "=== === === === === === === === === === ===" | tee -a compile.log
- echo "" | tee -a compile.log
- tail -c 5M compile.log | tee compile.log.temp
- mv compile.log.temp compile.log
- fi
|