Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolbox.prompt overwrites all items #753

Closed
imranMnts opened this issue Feb 9, 2022 · 5 comments
Closed

toolbox.prompt overwrites all items #753

imranMnts opened this issue Feb 9, 2022 · 5 comments
Labels

Comments

@imranMnts
Copy link
Contributor

imranMnts commented Feb 9, 2022

Describe the bug
toolbox.prompt.ask overwrites all items

To Reproduce

Issue :

let addNewItem = true;
const result = [];
while (addNewItem) {
  const item = await toolbox.prompt.ask({
      type: 'input',
      name: `name`,
      message: `message`,
  });

  result.push(item);
  addNewItem = await toolbox.prompt.confirm('continue?');
}
console.log('result: ', result);

the first time, we put 1 as name input, and 2 the second time

Result

print:
result: [ { name: '2', yesno: false }, { name: '2', yesno: false } ]

Expected behavior
print:
result: [ { name: '1' }, { name: '2' } ]

Doctor (please complete the following information):

  • OS: 11.6.2
  • Gluegun Version: 5.1.0
@jamonholmgren
Copy link
Member

@imranMnts Thanks for the bug report. Would you mind taking a shot at a PR?

@jamonholmgren
Copy link
Member

This would be a good opportunity for a regression test as well.

imranMnts added a commit to imranMnts/gluegun that referenced this issue Feb 10, 2022
@imranMnts
Copy link
Contributor Author

@jamonholmgren I created this PR #754

can you please have a look?

@imranMnts
Copy link
Contributor Author

@jamonholmgren

Can we have an update, please?

infinitered-circleci pushed a commit that referenced this issue Apr 19, 2022
## [5.1.2](v5.1.1...v5.1.2) (2022-04-19)

### Bug Fixes

* **prompt:** Addresses issue where prompt inputs get overwritten = fixes [#753](#753) ([#754](#754) by [@imran](https://github.com/imran)Mnts) ([6f6b2c6](6f6b2c6))
@infinitered-circleci
Copy link

🎉 This issue has been resolved in version 5.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants