Make ops tool work in production mode

This commit is contained in:
John Lyon-Smith
2018-03-19 15:47:06 -07:00
parent faf99108e9
commit 07a887d26f
2 changed files with 3 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ fi
# For scripts that need config access
export NODE_CONFIG_DIR="${script_dir}/config"
export NODE_ENV=production
if [[ ! -e "${script}" ]]; then
echo error: Script ${script} does not exist

View File

@@ -18,12 +18,11 @@ class AddUserTool {
}
async run() {
const mongoUri = config.get('uri.mongo')
try {
const mongoUri = config.get('uri.mongo')
const db = await new DB().connect(mongoUri)
console.log(`Connected to MongoDB at ${mongoUri}`)
console.log(`Connected to MongoDB at '${mongoUri}'`)
const User = db.User
let user = new User({