forked from alxpez/vuegg
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoauth-config.js
More file actions
32 lines (28 loc) · 780 Bytes
/
oauth-config.js
File metadata and controls
32 lines (28 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const inquirer = require('inquirer')
const shell = require('shelljs')
const dotenv = require('dotenv')
const setupQuestions = [
{
type: 'list',
name: 'runScript',
message: 'What to run, yo?!',
choices: [
'client',
'server',
new inquirer.Separator(),
'vuegg:test'
]
}
]
inquirer.prompt(setupQuestions).then(answers => {
if (answers.runScript === 'vuegg:test') {
dotenv.config({path: '.env.test'})
} else {
dotenv.config({path: '.env.dev'})
}
const execCommand = 'CLIENT_ID='.concat(process.env.CLIENT_ID)
.concat(' CLIENT_SECRET=').concat(process.env.CLIENT_SECRET)
.concat(' CALLBACK_URL=').concat(process.env.CALLBACK_URL)
.concat(' npm run ').concat(answers.runScript)
shell.exec(execCommand)
})