Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit 15212c3

Browse files
committed
fix: fixed return value
1 parent e40b375 commit 15212c3

File tree

4 files changed

+30
-16
lines changed

4 files changed

+30
-16
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"devDependencies": {
1818
"@oclif/config": "^1.3.57",
1919
"@oclif/errors": "^1.0.2",
20-
"@oclif/plugin-help": "^1.1.3",
21-
"@oclif/plugin-plugins": "^1.0.1",
20+
"@oclif/plugin-help": "^1.1.5",
21+
"@oclif/plugin-plugins": "^1.0.3",
2222
"@oclif/tslint": "^1.0.2",
2323
"@types/chai": "^4.1.2",
2424
"@types/mocha": "^2.2.48",

src/command.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default abstract class Command {
3232
if (!argv) argv = process.argv.slice(2)
3333
const config = await Config.load(opts || module.parent && module.parent.parent && module.parent.parent.filename || __dirname)
3434
let cmd = new this(argv, config)
35-
await cmd._run(argv)
35+
return cmd._run(argv)
3636
}
3737

3838
id: string | undefined

test/command.test.ts

+14
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ describe('command', () => {
2121
.do(output => expect(output.stdout).to.equal('foo\n'))
2222
.it('logs to stdout')
2323

24+
fancy
25+
.do(async () => {
26+
class Command extends Base {
27+
static description = 'test command'
28+
29+
async run() {
30+
return 101
31+
}
32+
}
33+
34+
expect(await Command.run([])).to.equal(101)
35+
})
36+
.it('returns value')
37+
2438
fancy
2539
.do(() => {
2640
class Command extends Base {

yarn.lock

+13-13
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
version "1.0.0"
1616
resolved "https://registry.yarnpkg.com/@heroku/linewrap/-/linewrap-1.0.0.tgz#a9d4e99f0a3e423a899b775f5f3d6747a1ff15c6"
1717

18-
"@oclif/command@^1.3.1":
19-
version "1.3.1"
20-
resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.3.1.tgz#b2e063034f2fd39d89729bb2fe8f9cb070c4b4e1"
18+
"@oclif/command@^1.3.3":
19+
version "1.4.0"
20+
resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.4.0.tgz#95c67b0a444e9f598baf5656e9964a54c39b9539"
2121
dependencies:
2222
"@oclif/parser" "^3.2.9"
2323
semver "^5.5.0"
@@ -42,24 +42,24 @@
4242
dependencies:
4343
"@heroku/linewrap" "^1.0.0"
4444

45-
"@oclif/plugin-help@^1.1.3":
46-
version "1.1.3"
47-
resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-1.1.3.tgz#2d0d280cb1cce485740237f029fd9a17fc568ce1"
45+
"@oclif/plugin-help@^1.1.5":
46+
version "1.1.5"
47+
resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-1.1.5.tgz#b7ae4d3a972851008ee399cd06bf4dff2a2105d5"
4848
dependencies:
49-
"@oclif/command" "^1.3.1"
49+
"@oclif/command" "^1.3.3"
5050
chalk "^2.3.1"
5151
indent-string "^3.2.0"
5252
lodash.template "^4.4.0"
5353
string-width "^2.1.1"
5454
widest-line "^2.0.0"
5555
wrap-ansi "^3.0.1"
5656

57-
"@oclif/plugin-plugins@^1.0.1":
58-
version "1.0.1"
59-
resolved "https://registry.yarnpkg.com/@oclif/plugin-plugins/-/plugin-plugins-1.0.1.tgz#9e9478fea9f153162b0530f62bb552703cbcbfb5"
57+
"@oclif/plugin-plugins@^1.0.3":
58+
version "1.0.3"
59+
resolved "https://registry.yarnpkg.com/@oclif/plugin-plugins/-/plugin-plugins-1.0.3.tgz#7fc080fee31e7f45b28154ab641efb78e81d5645"
6060
dependencies:
6161
"@heroku-cli/color" "^1.1.3"
62-
"@oclif/command" "^1.3.1"
62+
"@oclif/command" "^1.3.3"
6363
chalk "^2.3.1"
6464
cli-ux "^3.3.23"
6565
debug "^3.1.0"
@@ -870,8 +870,8 @@ universalify@^0.1.0:
870870
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7"
871871

872872
v8flags@^3.0.0:
873-
version "3.0.1"
874-
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.1.tgz#dce8fc379c17d9f2c9e9ed78d89ce00052b1b76b"
873+
version "3.0.2"
874+
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.2.tgz#ad6a78a20a6b23d03a8debc11211e3cc23149477"
875875
dependencies:
876876
homedir-polyfill "^1.0.1"
877877

0 commit comments

Comments
 (0)