Commit c51ca5b 1 parent fb7e4f7 commit c51ca5b Copy full SHA for c51ca5b
File tree 1 file changed +15
-9
lines changed
1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -132,17 +132,23 @@ class NginxExtension extends cli.Extension {
132
132
} , {
133
133
title : 'Preparing nginx for SSL configuration' ,
134
134
task : ( ctx ) => {
135
- return argv . sslemail ? Promise . resolve ( { email : argv . sslemail } ) : this . ui . prompt ( {
136
- name : 'email' ,
137
- type : 'input' ,
138
- message : 'Enter your email (used for SSL certificate generation)' ,
139
- validate : value => Boolean ( value ) || 'You must supply an email'
140
- } ) . then ( ( answer ) => {
141
- argv . sslemail = answer . email ;
135
+ let promise ;
136
+
137
+ if ( argv . sslemail ) {
138
+ promise = Promise . resolve ( argv . sslemail ) ;
139
+ } else {
140
+ promise = this . ui . prompt ( {
141
+ name : 'email' ,
142
+ type : 'input' ,
143
+ message : 'Enter your email (used for SSL certificate generation)' ,
144
+ validate : value => Boolean ( value ) || 'You must supply an email'
145
+ } ) . then ( answer => { argv . sslemail = answer . email ; } ) ;
146
+ }
142
147
143
- ctx . ssl = { } ;
148
+ return promise . then ( ( ) => {
149
+ return Promise . fromCallback ( ( cb ) => NginxConfFile . create ( nginxConfPath , cb ) ) . then ( ( conf ) => {
150
+ ctx . ssl = { } ;
144
151
145
- return Promise . fromNode ( ( cb ) => NginxConfFile . create ( nginxConfPath , cb ) ) . then ( ( conf ) => {
146
152
ctx . ssl . conf = conf ;
147
153
ctx . ssl . http = conf . nginx . server ;
148
154
ctx . ssl . http . _add ( 'location' , '~ /.well-known' ) ;
You can’t perform that action at this time.
0 commit comments