File tree Expand file tree Collapse file tree 7 files changed +29
-4
lines changed Expand file tree Collapse file tree 7 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,10 @@ export function checkout(program: Command): void {
241
241
description :
242
242
'Create a new version/commit with the specified name and checkout to it' ,
243
243
} ,
244
+ {
245
+ flags : '--dev' ,
246
+ description : 'Use localhost development environment' ,
247
+ } ,
244
248
] ,
245
249
action : async ( command , versionUuid , options ) => {
246
250
await command . execute ( versionUuid , options )
Original file line number Diff line number Diff line change @@ -329,6 +329,10 @@ export function init(program: Command): void {
329
329
description : 'Path to initialize the project in' ,
330
330
defaultValue : '.' ,
331
331
} ,
332
+ {
333
+ flags : '--dev' ,
334
+ description : 'Use localhost development environment' ,
335
+ } ,
332
336
] ,
333
337
action : async ( command , options ) => {
334
338
await command . execute ( options )
Original file line number Diff line number Diff line change @@ -325,6 +325,10 @@ export function pull(program: Command): void {
325
325
flags : '-y, --yes' ,
326
326
description : 'Skip confirmation and pull automatically' ,
327
327
} ,
328
+ {
329
+ flags : '--dev' ,
330
+ description : 'Use localhost development environment' ,
331
+ } ,
328
332
] ,
329
333
action : async ( command , options ) => {
330
334
await command . execute ( options )
Original file line number Diff line number Diff line change @@ -300,6 +300,10 @@ export function push(program: Command): void {
300
300
flags : '-y, --yes' ,
301
301
description : 'Skip confirmation and push automatically' ,
302
302
} ,
303
+ {
304
+ flags : '--dev' ,
305
+ description : 'Use localhost development environment' ,
306
+ } ,
303
307
] ,
304
308
action : async ( command , options ) => {
305
309
await command . execute ( options )
Original file line number Diff line number Diff line change @@ -258,6 +258,10 @@ export function status(program: Command): void {
258
258
description : 'Path to the project' ,
259
259
defaultValue : '.' ,
260
260
} ,
261
+ {
262
+ flags : '--dev' ,
263
+ description : 'Use localhost development environment' ,
264
+ } ,
261
265
] ,
262
266
action : async ( command , options ) => {
263
267
await command . execute ( options )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export type CommandHandler = (program: Command) => void
10
10
*/
11
11
export interface CommonOptions {
12
12
path : string
13
+ dev ?: boolean
13
14
}
14
15
15
16
/**
Original file line number Diff line number Diff line change @@ -36,10 +36,11 @@ export abstract class BaseCommand {
36
36
*/
37
37
abstract execute ( ...args : any [ ] ) : Promise < void >
38
38
39
- protected async setClient ( ) {
39
+ protected async setClient ( options ?: CommonOptions ) {
40
40
if ( ! this . client ) {
41
41
this . client = this . createLatitudeClient (
42
42
await this . configManager . getApiKey ( ) ,
43
+ options ,
43
44
)
44
45
}
45
46
@@ -57,8 +58,11 @@ export abstract class BaseCommand {
57
58
* Creates a Latitude client with the appropriate configuration
58
59
* Includes optional config for development environments
59
60
*/
60
- protected createLatitudeClient ( apiKey : string ) : Latitude {
61
- if ( process . env . NODE_ENV === 'development' ) {
61
+ protected createLatitudeClient (
62
+ apiKey : string ,
63
+ options ?: CommonOptions ,
64
+ ) : Latitude {
65
+ if ( process . env . NODE_ENV === 'development' || options ?. dev ) {
62
66
return new Latitude ( apiKey , {
63
67
__internal : {
64
68
gateway : {
@@ -83,7 +87,7 @@ export abstract class BaseCommand {
83
87
) : Promise < void > {
84
88
this . setProjectPath ( options )
85
89
86
- await this . setClient ( )
90
+ await this . setClient ( options )
87
91
await this . detectModuleFormat ( )
88
92
await validateEnvironment (
89
93
this . projectPath ,
You can’t perform that action at this time.
0 commit comments