Skip to content

Commit c9741f7

Browse files
committed
fix: show full path to file
1 parent 57b28db commit c9741f7

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

templates/src/command.js.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class <%- klass %> extends Command {
55
async run() {
66
const {flags} = this.parse(<%- klass %>)
77
const name = flags.name || 'world'
8-
this.log(`hello ${name} from ./src/<%- name %>.js!`)
8+
this.log(`hello ${name} from ${__filename}!`)
99
}
1010
}
1111

templates/src/command.ts.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ hello myname from .src/<%- name %>.ts!
3636
const {args, flags} = this.parse(<%- klass %>)
3737
3838
const name = flags.name || 'world'
39-
this.log(`hello ${name} from ./src/<%- name %>.ts!`)
39+
this.log(`hello ${name} from ${__filename}!`)
4040
if (args.file && flags.force) {
4141
this.log(`you input --force and --file: ${args.file}`)
4242
}

templates/test/command.test.js.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('<%- name %>', () => {
1212
.command(['<%- name %>'])
1313
<%_ } _%>
1414
.it('runs hello', ctx => {
15-
expect(ctx.stdout).to.contain('hello world from ./src/<%- name %>.js!')
15+
expect(ctx.stdout).to.contain('hello world')
1616
})
1717

1818
test
@@ -23,6 +23,6 @@ describe('<%- name %>', () => {
2323
.command(['<%- name %>', '--name', 'jeff'])
2424
<%_ } _%>
2525
.it('runs hello --name jeff', ctx => {
26-
expect(ctx.stdout).to.contain('hello jeff from ./src/<%- name %>.js!')
26+
expect(ctx.stdout).to.contain('hello jeff')
2727
})
2828
})

templates/test/command.test.ts.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('<%- name %>', () => {
1313
.command(['<%- name %>'])
1414
<%_ } _%>
1515
.it('runs hello', ctx => {
16-
expect(ctx.stdout).to.contain('hello world from ./src/<%- name %>.ts!')
16+
expect(ctx.stdout).to.contain('hello world')
1717
})
1818

1919
test
@@ -24,6 +24,6 @@ describe('<%- name %>', () => {
2424
.command(['<%- name %>', '--name', 'jeff'])
2525
<%_ } _%>
2626
.it('runs hello --name jeff', ctx => {
27-
expect(ctx.stdout).to.contain('hello jeff from ./src/<%- name %>.ts!')
27+
expect(ctx.stdout).to.contain('hello jeff')
2828
})
2929
})

test/run.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ module.exports = file => {
5252
case 'plugin':
5353
build(cmd, name)
5454
sh.exec('yarn test')
55+
sh.exec('node ./bin/run hello')
5556
sh.exec('node ./bin/run')
5657
sh.exec('node ./bin/run --help')
5758
sh.exec('yarn run prepublishOnly')

0 commit comments

Comments
 (0)