haixunMaster/scripts/pm2-common.sh

19 lines
402 B
Bash
Executable File

#!/usr/bin/env bash
# Shared env for PM2 wrapper scripts.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
# Playwright system libs (Linux server).
# shellcheck disable=SC1091
source "$ROOT/scripts/playwright-env.sh"
if [[ -f "$ROOT/.env" ]]; then
set -a
# shellcheck disable=SC1091
source "$ROOT/.env"
set +a
fi
export NODE_ENV="${NODE_ENV:-production}"