-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathnow-build.js
More file actions
23 lines (21 loc) · 854 Bytes
/
now-build.js
File metadata and controls
23 lines (21 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// const dotenv = require('dotenv').config(); //load .env
const path = require('path');
const profiles = require('@windingtree/config-profiles');
const activeProfile = profiles.determineActiveProfile();
console.log('Active profile:', activeProfile)
console.log('__filename:',__filename);
console.log('__dirname:',__dirname);
console.log('process.cwd():',process.cwd());
profiles.init({
baseFolder: path.join(process.cwd(),'api/profiles'),
dbUrl: profiles.getEnvironmentEntry(activeProfile, 'MONGO_URL'),
encryptionDetails: profiles.getEnvironmentEntry(activeProfile, 'PROFILE_SECRET')
}
)
profiles.dumpProfile(activeProfile).then(()=>{
console.log(`profile ${activeProfile} successfully generated`);
process.exit(0)
}).catch(err=>{
console.error(`profile ${activeProfile} generation failed, ${err}`)
process.exit(-1)
});