fix: show ts path in example command instead of js path
MODIFY
src/generators/command.ts
src/generators/command.ts
@@ -34,7 +34,7 @@ class CommandGenerator extends Generator {
let bin = this.pjson.oclif.bin || this.pjson.oclif.dirname || this.pjson.name
if (bin.includes('/')) bin = bin.split('/').pop()
const cmd = `${bin} ${this.options.name}`
- const opts = {...this.options, bin, cmd, _, type: 'command'}
+ const opts = {...this.options, bin, cmd, _, type: 'command', path: this._path}
this.fs.copyTpl(this.templatePath(`src/command.${this._ext}.ejs`), this.destinationPath(`src/commands/${this._path}.${this._ext}`), opts)
// this.fs.copyTpl(this.templatePath(`plugin/src/hooks/init.${this._ext}`), this.destinationPath(`src/hooks/init.${this._ext}`), this)
if (this._mocha) {

MODIFY
templates/src/command.ts.ejs
templates/src/command.ts.ejs
@@ -33,7 +33,7 @@ hello world from ./src/<%- name %>.ts!
const {args, flags} = this.parse(<%- klass %>)
const name = flags.name || 'world'
- this.log(`hello ${name} from ${__filename}!`)
+ this.log(`hello ${name} from ./src/<%- path %>.ts!`)
if (args.file && flags.force) {
this.log(`you input --force and --file: ${args.file}`)
}

fix: show ts path in example command instead of js path