Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/api/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import os from 'os';
import {
getEnvironmentVariable,
getEnvironmentVariables
} from './args';

const isWin = /^win/.test(process.platform);

Expand All @@ -8,11 +12,16 @@ export const getFolderName = (path, isWinOverride = isWin) => {
return pathParts[pathParts.length - 1];
};

export const getProjectName = async () => {
const environmentVariables = await getEnvironmentVariables();
return getEnvironmentVariable('PROJECT_NAME', environmentVariables)
Copy link
Owner

@jkrup jkrup Aug 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing semicolon ; here (you can run npm run lint to catch this stuff easily)

};

// run immediately
export const projectName = (() => getFolderName(process.cwd()))();
export const projectName = getProjectName() || (() => getFolderName(process.cwd()))();
export const homePath = os.homedir();
export const meteorNowBuildPath = isWin ? `${homePath}\\.meteor-now\\build` : `${homePath}/.meteor-now/build`;
export const tarFileName = `${projectName}.tar.gz`;
export const ignoreVarsArray = ['MONGO_URL', 'ROOT_URL', 'METEOR_SETTINGS', 'PORT'];
export const ignoreVarsArray = ['MONGO_URL', 'ROOT_URL', 'METEOR_SETTINGS', 'PORT', 'PROJECT_NAME'];
export const ignoreOptionsArray = ['deps', '_', '$0', 'help', 'version', 'nosplit'];
export const logPrefix = '[METEOR-NOW] - ';