Skip to content

Commit

Permalink
feat: Artifact 初始化后返回实例
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Feb 27, 2020
1 parent 75ae51f commit 7ca04cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/generator/artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class Artifact extends EventEmitter {
};
}

public async init(templateEngine?: Environment): Promise<void> {
public async init(templateEngine?: Environment): Promise<this> {
if (this.isReady) {
throw new Error('Artifact 已经初始化完成');
}
Expand Down Expand Up @@ -193,6 +193,8 @@ export class Artifact extends EventEmitter {
});

this.emit('initArtifact:end', { artifact: this.artifact });

return this;
}

public render(templateEngine?: Environment): string {
Expand Down

0 comments on commit 7ca04cf

Please sign in to comment.