-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
refactor(config): Move config handling to core.ps1 #3242
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with no .scoop
in $HOME
, work fine with changed codes.
When moving config, there are two |
L83-L87: If config value is scoop config debug true # okay
scoop config debug false # okay
scoop config debug false # error It can be fixed by replacing L83-L87 with $scoopConfig | Add-Member -Force -NotePropertyMembers @{ $name = $value } That is, force add note member (we want to set it, so force is okay, no matter if there is $name) |
Another implementation: pre-defined config file that contains all config options with default value, so we could only modify existing value, no need to add new ones. The pre-defined one can be put in scoop's root dir and copy to config home during first run. That may help users to know what configurable options is scoop having. |
5c7cb51
to
69fea43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There is only one thing remaining... Since
Black lines above is added by scoop itself, that's messy, I think. |
- Migrate ~\.scoop to ~\.config\scoop\config.json - Remove hashtable and hashtable_val functions because ConvertFrom-Json is enough - Add PowerShell 6 time conversion to tests
Co-Authored-By: r15ch13 <[email protected]>
Encode file in "ASCII", since "UTF8" in Powershell 5 will be "UTF8-with-BOM", while "ASCII" be "UTF8". Co-Authored-By: r15ch13 <[email protected]>
Co-Authored-By: r15ch13 <[email protected]>
Rebased onto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- The main bucket of Scoop has been separated to https://github.com/ScoopInstaller/Main - Requires PowerShell 5 and newer #3330 - Improve and refactor decompression functions #3204 #3409 #3411 - Move scoop config from `~\.scoop` to `~\.config\scoop\config.json` #3242 - Add `scoop hold` and `scoop unhold` for excluding programs from updates #3444 - Refactored some Core functions #3314 #3416 - Small fix for starting processes on Windows 7 #3415 Co-authored-by: Hsiao-nan Cheung <[email protected]> Co-authored-by: Chawye Hsu <[email protected]> Co-authored-by: Jakub Čábera <[email protected]>
~\.scoop
to~\.config\scoop\config.json
~\.config
is used by other tools too.json
file extensionhashtable
andhashtable_val
functions becauseConvertFrom-Json
is enoughConvertFrom-Json
can handle all data formatsconfig.ps1
imports frombin\*.ps1
andlibexec\*.ps1
requires changes to remove thescoop alias
hashtable
specific stuff.