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