File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,9 @@ export default function run(
98
98
'--pre-install' ) ;
99
99
noReload = true ;
100
100
}
101
+ // When not pre-installing the extension, we require a remote
102
+ // connection to Firefox.
103
+ const requiresRemote = ! preInstall ;
101
104
102
105
function createRunner ( ) {
103
106
return getValidatedManifest ( sourceDir )
@@ -142,19 +145,24 @@ export default function run(
142
145
} ) ;
143
146
} )
144
147
. then ( ( config ) => {
145
- return firefoxClient ( ) . then ( ( client ) => {
146
- return { client, ...config } ;
147
- } ) ;
148
+ if ( requiresRemote ) {
149
+ return firefoxClient ( ) . then ( ( client ) => {
150
+ return { client, ...config } ;
151
+ } ) ;
152
+ } else {
153
+ return config ;
154
+ }
148
155
} )
149
156
. then ( ( config ) => {
150
157
return new Promise (
151
158
( resolve ) => {
152
- const { runner, client } = config ;
159
+ const { runner} = config ;
153
160
if ( installed ) {
154
161
log . debug ( 'Not installing as temporary add-on because the ' +
155
162
'add-on was already installed' ) ;
156
163
resolve ( ) ;
157
164
} else {
165
+ const { client} = config ;
158
166
resolve ( runner . installAsTemporaryAddon ( client ) ) ;
159
167
}
160
168
} )
Original file line number Diff line number Diff line change @@ -182,6 +182,15 @@ describe('run', () => {
182
182
} ) ;
183
183
} ) ;
184
184
185
+ it ( 'will not connect to the debugger when using --pre-install' , ( ) => {
186
+ const cmd = prepareRun ( ) ;
187
+ const { firefoxClient} = cmd . options ;
188
+
189
+ return cmd . run ( { preInstall : true } ) . then ( ( ) => {
190
+ assert . equal ( firefoxClient . called , false ) ;
191
+ } ) ;
192
+ } ) ;
193
+
185
194
it ( 'allows you to opt out of extension reloading' , ( ) => {
186
195
const cmd = prepareRun ( ) ;
187
196
const { reloadStrategy} = cmd . options ;
You can’t perform that action at this time.
0 commit comments