Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

Commit

Permalink
fix: common-cli add extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
echosoar committed Dec 27, 2019
1 parent f1dc443 commit abfe339
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/faas-plugin-common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ export class Cli {
service: this.spec,
provider: this.providerName,
options: this.argv,
log: console,
log: this.loadLog(),
extensions: this.loadExtensions()
});
this.loadDefaultPlugin();
this.loadPlatformPlugin();
this.loadUserPlugin();
}

// 加载默认插件
loadDefaultPlugin() {
this.loadCommandPlugin();
this.loadCommandInvoke();
Expand All @@ -54,13 +56,24 @@ export class Cli {
this.core.addPlugin(CommandTest);
}

// 加载平台方插件
loadPlatformPlugin() {
}

// 加载cli拓展
loadExtensions() {
return {};
}

loadSpec() {
this.spec = loadSpec(baseDir);
}

// 加载命令行输出及报错
loadLog() {
return console;
}

error(errMsg) {
console.log('errMsg', errMsg);
process.exit(1);
Expand Down

0 comments on commit abfe339

Please sign in to comment.