mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
added support for DOMAIN env var insted of file
This commit is contained in:
parent
7d1bddd7e2
commit
d310895fcb
9 changed files with 53 additions and 29 deletions
|
@ -38,10 +38,18 @@ makeNextSubmodule() {
|
|||
checkFile "$PWD/src/server.ts"
|
||||
checkFile "$PWD/package.json"
|
||||
checkFile "$PWD/package-lock.json"
|
||||
if [ ! -f "${domainPath}" ]; then
|
||||
error "${domainPath} does not exist!"
|
||||
echo "Please create it, and re-run this script."
|
||||
echo "Expected content: domain, ex.:'frylabs.net' (without http:// and /)"
|
||||
|
||||
domain="${DOMAIN}"
|
||||
|
||||
if [ -z "${domain}" ] && [ -f "${domainPath}" ]; then
|
||||
domain=$(cat "${domainPath}")
|
||||
fi
|
||||
|
||||
if [ -z "${domain}" ]; then
|
||||
error "DOMAIN is not set, and ${domainPath} does not exist!"
|
||||
echo "Set DOMAIN to the preferred domain"
|
||||
echo "Or please create the file ${domainPath}, and re-run this script"
|
||||
echo "Expected content: domain, ex.:'frylabs.net' (without 'http://' and '/')"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -113,3 +121,4 @@ fi
|
|||
|
||||
# ------------------------------------------------------------------------------------
|
||||
log "Done! development mode: 'npm run dev', prod mode: 'npm run start', tests: 'npm run test'"
|
||||
exit 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue