This repository was archived by the owner on Aug 22, 2023. It is now read-only.
File tree 4 files changed +57
-12
lines changed
4 files changed +57
-12
lines changed Original file line number Diff line number Diff line change 11
11
]
12
12
},
13
13
"dependencies" : {
14
- "@oclif/errors" : " ^1.0.2 " ,
14
+ "@oclif/errors" : " ^1.0.3 " ,
15
15
"@oclif/parser" : " ^3.2.9" ,
16
16
"debug" : " ^3.1.0" ,
17
17
"semver" : " ^5.5.0"
18
18
},
19
19
"devDependencies" : {
20
- "@oclif/config" : " ^1.3.60 " ,
20
+ "@oclif/config" : " ^1.3.61 " ,
21
21
"@oclif/plugin-help" : " ^1.2.1" ,
22
22
"@oclif/plugin-plugins" : " ^1.0.8" ,
23
23
"@oclif/tslint" : " ^1.0.2" ,
Original file line number Diff line number Diff line change @@ -13,9 +13,14 @@ export class Main extends Command {
13
13
return super . run ( argv , options || module . parent && module . parent . parent && module . parent . parent . filename || __dirname )
14
14
}
15
15
16
- async run ( ) {
16
+ async init ( ) {
17
17
let [ id , ...argv ] = this . argv
18
18
await this . config . runHook ( 'init' , { id, argv} )
19
+ await super . init ( )
20
+ }
21
+
22
+ async run ( ) {
23
+ let [ id , ...argv ] = this . argv
19
24
this . parse ( { strict : false , '--' : false , ...this . ctor as any } )
20
25
if ( ! this . config . findCommand ( id ) ) {
21
26
let topic = this . config . findTopic ( id )
Original file line number Diff line number Diff line change
1
+ import { expect , fancy } from 'fancy-test'
2
+
3
+ import { Main } from '../src/main'
4
+
5
+ const pjson = require ( '../package.json' )
6
+ const version = `@oclif/command/${ pjson . version } ${ process . platform } -${ process . arch } node-${ process . version } `
7
+
8
+ describe ( 'main' , ( ) => {
9
+ fancy
10
+ . stdout ( )
11
+ . do ( ( ) => Main . run ( [ 'plugins' ] ) )
12
+ . do ( output => expect ( output . stdout ) . to . equal ( 'no plugins installed\n' ) )
13
+ . it ( 'runs plugins' )
14
+
15
+ fancy
16
+ . stdout ( )
17
+ . do ( ( ) => Main . run ( [ '-v' ] ) )
18
+ . catch ( 'EEXIT: 0' )
19
+ . do ( output => expect ( output . stdout ) . to . equal ( version + '\n' ) )
20
+ . it ( 'runs -v' )
21
+
22
+ fancy
23
+ . stdout ( )
24
+ . do ( ( ) => Main . run ( [ '-h' ] ) )
25
+ . catch ( 'EEXIT: 0' )
26
+ . do ( output => expect ( output . stdout ) . to . equal ( `oclif base command
27
+
28
+ VERSION
29
+ ${ version }
30
+
31
+ USAGE
32
+ $ @oclif/command [COMMAND]
33
+
34
+ COMMANDS
35
+ help display help for @oclif/command
36
+ plugins list installed plugins
37
+
38
+ ` ) )
39
+ . it ( 'runs -h' )
40
+ } )
Original file line number Diff line number Diff line change 40
40
debug "^3.1.0"
41
41
semver "^5.5.0"
42
42
43
- " @oclif/config@^1.3.60 " :
44
- version "1.3.60 "
45
- resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.3.60 .tgz#e5e1b1cf14d68dd55c489bc5f76594073dec0568 "
43
+ " @oclif/config@^1.3.61 " :
44
+ version "1.3.61 "
45
+ resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.3.61 .tgz#1d2293d1c78dc9d88e408afd35dea9a6dccecf84 "
46
46
dependencies :
47
47
debug "^3.1.0"
48
48
49
- " @oclif/errors@^1.0.2 " :
50
- version "1.0.2 "
51
- resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.0.2 .tgz#0a3f773d673a3ccd8dc26bf2e3c49580afcbe30e "
49
+ " @oclif/errors@^1.0.2" , "@oclif/errors@^1.0.3" :
50
+ version "1.0.3 "
51
+ resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.0.3 .tgz#f23c024075855c7d116d041ee158f99bd51175af "
52
52
dependencies :
53
53
clean-stack "^1.3.0"
54
54
fs-extra "^5.0.0"
448
448
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
449
449
450
450
http-call@^5.0.2 :
451
- version "5.0.2 "
452
- resolved "https://registry.yarnpkg.com/http-call/-/http-call-5.0.2. tgz#21bec3655f1631de128c0cdaa470777b1fbbc365 "
451
+ version "5.1.0 "
452
+ resolved "https://registry.yarnpkg.com/http-call/-/http-call-5.1.0. tgz#699847d9bcd635eb4e3fdfe3084456a9c89d716d "
453
453
dependencies :
454
454
content-type "^1.0.4"
455
455
debug "^3.1.0"
456
456
is-retry-allowed "^1.1.0"
457
457
is-stream "^1.1.0"
458
- tslib "^1.8.1 "
458
+ tslib "^1.9.0 "
459
459
tunnel-agent "^0.6.0"
460
460
461
461
indent-string@^3.2.0 :
You can’t perform that action at this time.
0 commit comments