0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

Move process.chdir up so it occurs before config.js is ever called.

app.js should be required before config to make sure process.cwd is updated first
This commit is contained in:
Trevor Buckner
2022-01-30 00:13:35 -05:00
parent d7aa4afa60
commit ccbeca2cad

View File

@@ -1,4 +1,7 @@
/*eslint max-lines: ["warn", {"max": 300, "skipBlankLines": true, "skipComments": true}]*/
// Set working directory to project root
process.chdir(`${__dirname}/..`);
const _ = require('lodash');
const jwt = require('jwt-simple');
const express = require('express');
@@ -14,9 +17,6 @@ const asyncHandler = require('express-async-handler');
const brewAccessTypes = ['edit', 'share', 'raw'];
// Set working directory to project root
process.chdir(`${__dirname}/..`);
//Get the brew object from the HB database or Google Drive
const getBrewFromId = asyncHandler(async (id, accessType)=>{
if(!brewAccessTypes.includes(accessType))