mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 19:34:34 +00:00
chore: copy sas exe script extracted common
This commit is contained in:
@@ -3,6 +3,7 @@ import mongoose from 'mongoose'
|
||||
import { configuration } from '../../package.json'
|
||||
import { getDesktopFields } from '.'
|
||||
import { populateClients } from '../routes/api/auth'
|
||||
import { fileExists } from '@sasjs/utils'
|
||||
|
||||
export const connectDB = async () => {
|
||||
const { MODE } = process.env
|
||||
@@ -18,10 +19,13 @@ export const connectDB = async () => {
|
||||
} else {
|
||||
const { SAS_EXEC } = process.env
|
||||
process.sasLoc = SAS_EXEC
|
||||
? path.join(__dirname, '..', '..', '...', SAS_EXEC)
|
||||
? path.join(__dirname, '..', '..', '..', SAS_EXEC)
|
||||
: configuration.sasPath
|
||||
}
|
||||
|
||||
console.log('SAS_EXEC: ', process.sasLoc)
|
||||
console.log('SAS_EXEC Exists: ', await fileExists(process.sasLoc))
|
||||
|
||||
// NOTE: when exporting app.js as agent for supertest
|
||||
// we should exlcude connecting to the real database
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
|
||||
Reference in New Issue
Block a user