diff --git a/deploy.js b/deploy.js index 746448d..2b763fd 100644 --- a/deploy.js +++ b/deploy.js @@ -280,7 +280,9 @@ server { // Run console.log(`Running`); const pm2NeverRan = (await ssh.execCommand(`npx pm2 show ${APP_NAME}`, {cwd: REMOTE_ROOT})).stdout === ""; - const envVariables = `HOST=${PRODUCTION ? INTERNAL_HOST_PRODUCTION : INTERNAL_HOST_DEVELOPMENT} PORT=${PRODUCTION ? INTERNAL_PORT_PRODUCTION : INTERNAL_PORT_DEVELOPMENT}`; + const envVariables = `PRODUCTION=${String(PRODUCTION)} HOST=${PRODUCTION ? INTERNAL_HOST_PRODUCTION : INTERNAL_HOST_DEVELOPMENT} PORT=${ + PRODUCTION ? INTERNAL_PORT_PRODUCTION : INTERNAL_PORT_DEVELOPMENT + }`; if (pm2NeverRan) { await ssh.execCommand(`${envVariables} npx pm2 start npm --name "${APP_NAME}" -- start`, {cwd: REMOTE_ROOT}); } else { diff --git a/src/constant/constant.ts b/src/constant/constant.ts index 8de2560..cbc3f3e 100644 --- a/src/constant/constant.ts +++ b/src/constant/constant.ts @@ -8,7 +8,7 @@ import {booleanize} from "../util/booleanize/booleanize"; const tempRoot = join( tempDirectory, environment.NPM_PACKAGE_NAME, - process.env.PRODUCTION != null && (process.env.PRODUCTION === "" || booleanize(process.env.PRODUCTION)) ? "production" : "development" + (process.env.PRODUCTION != null && (process.env.PRODUCTION === "" || booleanize(process.env.PRODUCTION))) || process.env.NODE_ENV === "production" ? "production" : "development" ); export const constant: IConstant = {