reformatted to use my template
This commit is contained in:
42
scripts/mac-linux/start
Normal file
42
scripts/mac-linux/start
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
#change to current directory
|
||||
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
|
||||
cd ../..
|
||||
|
||||
#colors
|
||||
C1='\033[1;37m'
|
||||
C2='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
#make log folder
|
||||
if [[ ! -d log ]]
|
||||
then
|
||||
mkdir log
|
||||
fi
|
||||
|
||||
#current file number
|
||||
num=0
|
||||
if [[ -f log/number ]]
|
||||
then
|
||||
num=$(cat log/number)
|
||||
fi
|
||||
|
||||
echo $num > log/number
|
||||
|
||||
#watchdog
|
||||
while true
|
||||
do
|
||||
|
||||
#increment log file number
|
||||
num=$(( num + 1 ))
|
||||
echo $num > log/number
|
||||
|
||||
#run
|
||||
npm start 2> log/$num.err | tee log/$num.out
|
||||
|
||||
#give chance to close program
|
||||
printf "\n\n\n${C1}press ${C2}Control+C${C1} to close${NC}\n\n\n"
|
||||
sleep 5
|
||||
|
||||
done
|
||||
Reference in New Issue
Block a user