updated unix scripts
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#change to ccurrent directory
|
||||
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
|
||||
cd ../..
|
||||
|
||||
#run
|
||||
npm install
|
||||
@@ -1,14 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/bash
|
||||
|
||||
#change to ccurrent directory
|
||||
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
|
||||
cd ../..
|
||||
|
||||
#colors
|
||||
C1='\033[1;37m'
|
||||
C2='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
|
||||
cd ../..
|
||||
#make log folder
|
||||
if [[ ! -d log ]]
|
||||
then
|
||||
mkdir log
|
||||
fi
|
||||
|
||||
while true; do
|
||||
npm start
|
||||
printf "\n\n\n${C1}press ${C2}Control+C${C1} to close${NC}\n\n\n"
|
||||
#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 >> log/$num.out 2> log/$num.err
|
||||
|
||||
#give chance to close program
|
||||
sleep 5
|
||||
printf "\n\n\n${C1}press ${C2}Control+C${C1} to close${NC}\n\n\n"
|
||||
done
|
||||
Reference in New Issue
Block a user