Initial changes to error messages

This commit is contained in:
Frank Li 2017-08-09 15:43:30 -07:00
parent e285f93c1b
commit b256d2f8d9
7 changed files with 45 additions and 6 deletions

View file

@ -11,11 +11,23 @@
require("babel-register")({
babelrc: false,
only: [__dirname, process.cwd() + "/core"],
only: [__dirname, process.cwd() + "/core"],
plugins: [require("./server/translate-plugin.js")],
presets: ["react", "latest"]
});
// initial check that required files are present
const chalk = require("chalk");
const fs = require("fs");
const CWD = process.cwd();
if (!fs.existsSync(CWD + "/siteConfig.js")) {
console.error(
chalk.red("Error: No siteConfig.js file found in website folder!")
);
process.exit(1);
}
const program = require("commander");
program.option("--port <number>", "Specify port number").parse(process.argv);