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

fix(config): Fix set_config bugs #3681

Merged
merged 4 commits into from
Feb 10, 2022
Merged

Conversation

jantari
Copy link
Contributor

@jantari jantari commented Oct 11, 2019

Same as: #3680 but in develop branch -->


  • Out-Null is slow, casting to [void] or assigning to $null is much faster
  • Add parameter names instead of relying on position
  • Do not allow null or empty string for $name - function would previously thow an error if that occured, and it doesn't make sense to allow for it
  • if $scoopConfig was $null and $value was a boolean-string ("True"/"False") it would previously not have been converted to a bool-type and saved in the JSON as a string-value instead. Fixed by moving the bool-conversion logic outside of the unrelated if-statement

Same as: ScoopInstaller#3680 but in develop branch -->

---

- `Out-Null` is slow, casting to `[void]` or assigning to `$null` is much faster
- Add parameter names instead of relying on position
- Do not allow null or empty string for `$name` - function would previously thow an error if that occured, and it doesn't make sense to allow for it
- if `$scoopConfig` was `$null` and `$value` was a boolean-string ("True"/"False") it would previously not have been converted to a bool-type and saved in the JSON as a string-value instead. Fixed by moving the bool-conversion logic outside of the unrelated if-statement
lib/core.ps1 Outdated Show resolved Hide resolved
As per discussion in ScoopInstaller#3681 - in the interest of readability
@rashil2000 rashil2000 changed the title fix some problems in core.ps1 - set_config fix some problems set_config Jan 8, 2022
@niheaven niheaven changed the title fix some problems set_config fix(config): Fix set_config bugs Feb 10, 2022
@niheaven niheaven merged commit ef2bfeb into ScoopInstaller:develop Feb 10, 2022
se35710 pushed a commit to se35710/scoop that referenced this pull request Mar 8, 2022
Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants