This repository has been archived on 2025-01-04. You can view files and clone it, but cannot push or open issues or pull requests.

40 lines
863 B
Bash
Raw Normal View History

2023-03-07 05:02:02 -06:00
#!/bin/bash
# Date: 2023-03-07
# Developer: Hyperling
# Purpose: Install all dependencies and run the project.
## Install any system packages. ##
2023-03-07 05:02:02 -06:00
if [[ -z `which npm` ]]; then
2023-03-07 05:15:22 -06:00
echo "NPM needs to be installed."
2023-03-07 05:02:02 -06:00
sudo apt install npm
2023-03-07 05:15:22 -06:00
else
echo "NPM is already available."
2023-03-07 05:02:02 -06:00
fi
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"
2023-03-07 05:02:02 -06:00
npm install package.json
## Main ##
# 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
2023-03-07 05:15:22 -06:00
# Or just run them each with & and then kill with another shell script?