mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
added bit more advanced file existance checking, removed vhosts in favor or routes
This commit is contained in:
parent
ba89f4a342
commit
113a114821
24 changed files with 2720 additions and 2474 deletions
|
@ -8,7 +8,7 @@ hr() {
|
|||
|
||||
log() {
|
||||
hr
|
||||
echo -e "\033[0;32m${@}\033[0m"
|
||||
echo -e "\033[0;34m${@}\033[0m"
|
||||
hr
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@ makeNextSubmodule() {
|
|||
npm audit fix > /dev/null 2> /dev/null
|
||||
npm run export
|
||||
popd || exit
|
||||
// TODO: check if link exists
|
||||
linkTarget="$PWD/nextStatic/${2}"
|
||||
if [ ! -f "${linkTarget}" ]; then
|
||||
ln -sf "$PWD/submodules/${1}/out" "${linkTarget}"
|
||||
|
@ -45,8 +46,8 @@ checkFile "$PWD/src/server.ts"
|
|||
checkFile "$PWD/package.json"
|
||||
checkFile "$PWD/package-lock.json"
|
||||
|
||||
git pull
|
||||
git submodule update --init --recursive
|
||||
git pull || exit
|
||||
git submodule update --init --recursive || exit
|
||||
|
||||
|
||||
log "Making project"
|
||||
|
@ -54,7 +55,6 @@ npm install
|
|||
npm audit fix > /dev/null 2> /dev/null
|
||||
npm run export
|
||||
|
||||
log "Seting up next.js static stuff..."
|
||||
mkdir "$PWD/nextStatic"
|
||||
|
||||
# ------------------------------------------------------------------------------------
|
||||
|
@ -71,11 +71,11 @@ ln -sfv "$PWD/submodules/moodle-test-userscript/stable.user.js" "$PWD/publicDirs
|
|||
log "mkdir-ing/touching :3"
|
||||
|
||||
# TODO: make server create these itself
|
||||
mkdir -p stats
|
||||
mkdir -p stats/logs
|
||||
mkdir -p stats/vlogs
|
||||
mkdir -p data
|
||||
mkdir -p data/dbs
|
||||
mkdir -pv stats
|
||||
mkdir -pv stats/logs
|
||||
mkdir -pv stats/vlogs
|
||||
mkdir -pv data
|
||||
mkdir -pv data/dbs
|
||||
touch data/nolog
|
||||
|
||||
#JSONS
|
||||
|
@ -92,7 +92,7 @@ touch publicDirs/qminingPublic/motd
|
|||
if [ -z "$(ls -A ./data/dbs)" ]; then
|
||||
log "Making DB-s"
|
||||
pushd src/standaloneUtils || exit
|
||||
NS_LOGLEVEL=2 node dbSetup.js
|
||||
NS_SQL_DEBUG_LOG=1 NS_LOGLEVEL=2 node dbSetup.js
|
||||
mv ./*.db ../../data/dbs
|
||||
popd || exit
|
||||
fi
|
||||
|
@ -100,4 +100,4 @@ fi
|
|||
log "Disabling next telemetry"
|
||||
npx --yes next telemetry disable
|
||||
|
||||
log "Done!"
|
||||
log "Done! development mode: 'npm run dev', prod mode: 'npm run start', tests: 'npm run test'"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue