From ed1f665dbdcb55fa2749bc28ee769c9fd0565460 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 7 Mar 2023 05:52:25 -0600 Subject: [PATCH] More work on how the project might run. --- run.sh | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/run.sh b/run.sh index 12ae416..462b718 100755 --- a/run.sh +++ b/run.sh @@ -3,20 +3,37 @@ # Developer: Hyperling # Purpose: Install all dependencies and run the project. -# Install any system packages. +## Install any system packages. ## if [[ -z `which npm` ]]; then echo "NPM needs to be installed." sudo apt install npm else - echo "NPM is already installed." + echo "NPM is already available." fi -# Install/update any project modules. -echo "Ensuring NPM packages are correct." +if [[ -z `which tsc` ]]; then + echo "TSC needs to be installed." + sudo apt install node-typescript +else + echo "TSC is already available." +fi + +## Install/update any project modules. ## +echo "Refreshing NPM packages." +bash -c "rm -r node_modules package-lock.json" npm install package.json -# Start backend -node ./server.js +## Main ## -# Start frontend. -# ??? +# Fork somehow other than just doing &? Then... + +if [[ $parent ]]; then + # Start backend + node `pwd`/server.js >server.log 2>&1 & +else + # Start frontend. + tsc index.tsx + # ??? `pwd`/dist/index.js >ui.log 2>&1 +fi + +# Or just run them each with & and then kill with another shell script?