From ccbeca2cad578353151c23eae3d16841efa818a3 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sun, 30 Jan 2022 00:13:35 -0500 Subject: [PATCH] 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 --- server/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/app.js b/server/app.js index c9ebf6a19..2437e3b38 100644 --- a/server/app.js +++ b/server/app.js @@ -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))