More work on how the project might run.

This commit is contained in:
Hyperling 2023-03-07 05:52:25 -06:00
parent 4a524d4155
commit ed1f665dbd

33
run.sh
View File

@ -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?