File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
tests/e2e/tests/commands/config Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { Command , Option } from '../models/command' ;
2
+
3
+ export interface Options {
4
+ keyword : string ;
5
+ search ?: boolean ;
6
+ }
7
+
8
+ export default class GetSetCommand extends Command {
9
+ public readonly name = 'getset' ;
10
+ public readonly description = 'Deprecated in favor of config command.' ;
11
+ public readonly arguments : string [ ] = [ ] ;
12
+ public readonly options : Option [ ] = [ ] ;
13
+
14
+ public async run ( _options : Options ) {
15
+ this . logger . warn ( 'get/set have been deprecated in favor of the config command.' ) ;
16
+ }
17
+ }
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ function loadCommands() {
33
33
'help' : require ( '../../commands/help' ) . default ,
34
34
'version' : require ( '../../commands/version' ) . default ,
35
35
'doc' : require ( '../../commands/doc' ) . default ,
36
+
37
+ // deprecated
38
+ 'get' : require ( '../../commands/getset' ) . default ,
39
+ 'set' : require ( '../../commands/getset' ) . default ,
36
40
} ;
37
41
}
38
42
Original file line number Diff line number Diff line change
1
+ import { ng } from '../../../utils/process' ;
2
+
3
+
4
+ export default function ( ) {
5
+ const depRegEx = / g e t \/ s e t h a v e b e e n d e p r e c a t e d i n f a v o r o f t h e c o n f i g c o m m a n d \. / ;
6
+ return Promise . resolve ( )
7
+ . then ( ( ) => ng ( 'get' ) )
8
+ . then ( ( { stdout } ) => {
9
+ if ( ! stdout . match ( depRegEx ) ) {
10
+ throw new Error ( `Expected deprecation warning.` ) ;
11
+ }
12
+ } )
13
+ . then ( ( ) => ng ( 'set' ) )
14
+ . then ( ( { stdout } ) => {
15
+ if ( ! stdout . match ( depRegEx ) ) {
16
+ throw new Error ( `Expected deprecation warning.` ) ;
17
+ }
18
+ } ) ;
19
+ }
You can’t perform that action at this time.
0 commit comments