简体   繁体   English

如何以编程方式读取当前运行的 oclif 应用程序的版本?

[英]How do I programatically read the version of a currently running oclif app?

This title says it all: How do I programatically read the version of a currently running oclif command-line app (from within the app)?这个标题说明了一切:如何以编程方式读取当前运行的 oclif 命令行应用程序的版本(从应用程序内部)?

Luckily answer was pretty simple:幸运的是答案很简单:

export default class Foo extends Command {

  async run() {
    console.log(this.config.version);
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM