From 9067a67bd5a3bdfc2f9c402b4b3755d8776edd46 Mon Sep 17 00:00:00 2001 From: ashley zomo Date: Thu, 27 Jan 2022 20:05:27 -0600 Subject: [PATCH] updated unix scripts --- scripts/mac-linux/install | 2 ++ scripts/mac-linux/start | 38 ++++++++++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/scripts/mac-linux/install b/scripts/mac-linux/install index 38e3642..c332d3d 100755 --- a/scripts/mac-linux/install +++ b/scripts/mac-linux/install @@ -1,6 +1,8 @@ #!/usr/bin/env bash +#change to ccurrent directory cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" cd ../.. +#run npm install \ No newline at end of file diff --git a/scripts/mac-linux/start b/scripts/mac-linux/start index b85d758..d58c9ad 100755 --- a/scripts/mac-linux/start +++ b/scripts/mac-linux/start @@ -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 \ No newline at end of file