Commit d0ff7fe 1 parent 1b7bf97 commit d0ff7fe Copy full SHA for d0ff7fe
File tree 3 files changed +21
-21
lines changed
3 files changed +21
-21
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,15 @@ class SetupCommand extends Command {
147
147
}
148
148
149
149
return this . ui . listr ( tasks , { setup : true } ) . then ( ( ) => {
150
- if ( ! argv . prompt || argv . start ) {
150
+ // If we are not allowed to prompt, set the default value, which should be true
151
+ if ( ! argv . prompt ) {
152
+ argv . start = true ;
153
+ }
154
+
155
+ // If argv.start has a value, this means either --start or --no-start were explicitly provided
156
+ // (or --no-prompt was provided, and we already defaulted to true)
157
+ // In this case, we don't prompt, we use the value of argv.start
158
+ if ( argv . start || argv . start === false ) {
151
159
return Promise . resolve ( { yes : argv . start } ) ;
152
160
}
153
161
@@ -163,9 +171,8 @@ SetupCommand.description = 'Setup an installation of Ghost (after it is installe
163
171
SetupCommand . params = '[stages..]' ;
164
172
SetupCommand . options = {
165
173
start : {
166
- description : 'Automatically start Ghost without prompting' ,
167
- type : 'boolean' ,
168
- default : false
174
+ description : '[--no-start] Enable/disable automatically starting Ghost' ,
175
+ type : 'boolean'
169
176
} ,
170
177
local : {
171
178
alias : 'l' ,
Original file line number Diff line number Diff line change @@ -35,26 +35,18 @@ class StartCommand extends Command {
35
35
instance . running = this . system . environment ;
36
36
} ) ;
37
37
38
+ // @TODO --quiet will make enable never happen!
38
39
if ( argv . quiet ) {
39
40
return start ( ) ;
40
41
}
41
42
42
43
return this . ui . run ( start , 'Starting Ghost' ) . then ( ( ) => {
43
- // If process manager doesn't support enable behavior OR
44
- // it's already enabled, then skip prompt
44
+ // If process manager doesn't support enable behavior OR it's already enabled, don't try to enable
45
45
if ( ! ProcessManager . supportsEnableBehavior ( processInstance ) || processInstance . isEnabled ( ) ) {
46
- return Promise . resolve ( { yes : false } ) ;
46
+ argv . enable = false ;
47
47
}
48
48
49
- // If prompts are disabled or enable is passed,
50
- // skip prompt
51
- if ( argv . enable || ! argv . prompt ) {
52
- return Promise . resolve ( { yes : argv . enable } ) ;
53
- }
54
-
55
- return this . ui . confirm ( 'Do you wish to enable the Ghost instance to start on reboot?' )
56
- } ) . then ( ( answer ) => {
57
- if ( ! answer . yes ) {
49
+ if ( ! argv . enable ) {
58
50
return Promise . resolve ( ) ;
59
51
}
60
52
@@ -74,8 +66,9 @@ class StartCommand extends Command {
74
66
StartCommand . description = 'Start an instance of Ghost' ;
75
67
StartCommand . options = {
76
68
enable : {
77
- description : 'Enable the instance to restart on server reboot (if the process manager supports it)' ,
78
- type : 'boolean'
69
+ description : '[--no-enable] Enable/don\'t enable the instance to restart on server reboot (if the process manager supports it)' ,
70
+ type : 'boolean' ,
71
+ default : true
79
72
}
80
73
} ;
81
74
Original file line number Diff line number Diff line change @@ -33,9 +33,9 @@ class UninstallCommand extends Command {
33
33
skip : ( ) => ! instance . running ,
34
34
task : ( ) => {
35
35
instance . loadRunningEnvironment ( true ) ;
36
- // If the instance is currently running we need to make
37
- // sure it gets stopped
38
- return this . runCommand ( StopCommand , { quiet : true } ) ;
36
+ // If the instance is currently running we need to make sure
37
+ // it gets stopped and disabled if possible
38
+ return this . runCommand ( StopCommand , { disable : true } ) ;
39
39
}
40
40
} , {
41
41
title : 'Removing related configuration' ,
You can’t perform that action at this time.
0 commit comments