mirror of
https://gitlab.com/MrFry/qmining-data-editor
synced 2025-04-01 20:24:01 +02:00
DOMAIN env var functionality improvements
This commit is contained in:
parent
89edf86099
commit
f8d423f162
2 changed files with 11 additions and 4 deletions
11
make.sh
11
make.sh
|
@ -2,11 +2,16 @@
|
||||||
scriptPath=$(dirname -- "${0}")
|
scriptPath=$(dirname -- "${0}")
|
||||||
domainPath="${scriptPath}/../../data/domain"
|
domainPath="${scriptPath}/../../data/domain"
|
||||||
|
|
||||||
if [ ! -f "${domainPath}" ]; then
|
domain="${DOMAIN}"
|
||||||
echo -e "\033[0;41m${domainPath} does not exist!\033[0m"
|
|
||||||
|
if [ -z "${domain}" ] && [ -f "${domainPath}" ]; then
|
||||||
|
domain=$(cat "${domainPath}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${domain}" ]; then
|
||||||
|
echo -e "\033[0;41mDOMAIN is not set, and ${domainPath} does not exist!\033[0m"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
domain=$(cat "${domainPath}")
|
|
||||||
|
|
||||||
NEXT_PUBLIC_DOMAIN="${domain}" npm run export
|
NEXT_PUBLIC_DOMAIN="${domain}" npm run export
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,9 @@ const useLocalhost = process && process.env.NODE_ENV === 'development'
|
||||||
const domain = process && process.env.NEXT_PUBLIC_DOMAIN
|
const domain = process && process.env.NEXT_PUBLIC_DOMAIN
|
||||||
|
|
||||||
if (!domain && !useLocalhost) {
|
if (!domain && !useLocalhost) {
|
||||||
throw new Error('Domain is not defined! Please set DOMAIN env variable!')
|
throw new Error(
|
||||||
|
'Domain is not defined! Please set NEXT_PUBLIC_DOMAIN env variable!'
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const constants = {
|
const constants = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue