Make ops tool work in production mode
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user