Skip to content

Commit da582ea

Browse files
added prompts for env file generation
1 parent 948b679 commit da582ea

3 files changed

Lines changed: 30 additions & 3 deletions

File tree

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
NODE_ENV=development
2-
VUE_APP_ROOT_API=//url.local/api
3-
VUE_APP_OAUTH_CLIENT_SECRET=
2+
VUE_APP_ROOT_API=<%= options.rootUrl %>
3+
<%_ if (options.useAuthorisation) { _%>
4+
VUE_APP_OAUTH_CLIENT_ID=<%= options.oauthClientId %>
5+
VUE_APP_OAUTH_CLIENT_SECRET=<%= options.oauthSecret %>
6+
<%_ } _%>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
NODE_ENV=development
22
VUE_APP_ROOT_API=//url.local/api
3-
VUE_APP_OAUTH_CLIENT_SECRET=
3+
<%_ if (options.useAuthorisation) { _%>
4+
VUE_APP_OAUTH_CLIENT_SECRET=
5+
<%_ } _%>

prompts.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
function useAuthorisation (answers) {
2+
return answers.useAuthorisation
3+
}
4+
15
module.exports = [
26
{
37
name: 'useCrud',
@@ -16,5 +20,23 @@ module.exports = [
1620
type: 'confirm',
1721
message: 'Do you want to use authorisation (Login/register/invitation/password forgotten)',
1822
default: true,
23+
},
24+
{
25+
name: 'oauthClientId',
26+
type: 'input',
27+
message: 'What is the oauth client id? (run php artisan passport:client --password (you can change this later)',
28+
when: useAuthorisation
29+
},
30+
{
31+
name: 'oauthSecret',
32+
type: 'input',
33+
message: 'What is the oauth client secret? (run php artisan passport:client --password (you can change this later)',
34+
when: useAuthorisation
35+
},
36+
{
37+
name: 'rootUrl',
38+
type: 'input',
39+
message: 'What is the root API url? (you can change this later)',
40+
default: '//example.local/api',
1941
}
2042
];

0 commit comments

Comments
 (0)