Skip to content

Commit

Permalink
chore: addon generator to async/await (#849)
Browse files Browse the repository at this point in the history
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. -->

**What kind of change does this PR introduce?**
refactor
<!-- E.g. a bugfix, feature, refactoring, build related change, etc… -->

**Did you add tests for your changes?**
yes

**If relevant, did you update the documentation?**
NA

**Summary**
* Move async gen to async await.

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
<!-- Try to link to an open issue for more information. -->

**Does this PR introduce a breaking change?**
<!-- If this PR introduces a breaking change, please describe the impact and a migration path for existing applications. -->
No

**Other information**
Not yet
  • Loading branch information
anshumanv authored and ematipico committed Apr 23, 2019
1 parent 46049e6 commit c1c33ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 36 deletions.
41 changes: 11 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions packages/generators/addon-generator.ts
Expand Up @@ -39,12 +39,9 @@ export default function addonGenerator(
public copy: (value: string, index: number, array: string[]) => void;
public copyTpl: (value: string, index: number, array: string[]) => void;

public prompting(): Promise<{}> {
return this.prompt(prompts).then(
(props: InquirerScaffoldObject): void => {
this.props = props;
}
);
public async prompting(): Promise<void> {
const scaffoldObject: InquirerScaffoldObject = await this.prompt(prompts);
this.props = scaffoldObject;
}

public default(): void {
Expand Down

0 comments on commit c1c33ae

Please sign in to comment.