-
Notifications
You must be signed in to change notification settings - Fork 11
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
support reading scoop home from the config file #30
support reading scoop home from the config file #30
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.
For my reference:
- scoop installer decides about the root path using the param value but fallbacking to
$env:SCOOP
(https://github.com/ScoopInstaller/Install/blob/f1cf244456a4201a4ee3d1ad8cea2ac96e301198/install.ps1#L559) - the config path is determined based off the XDG directory or just
~/.config
(https://github.com/ScoopInstaller/Install/blob/f1cf244456a4201a4ee3d1ad8cea2ac96e301198/install.ps1#L571) - BUT once scoop is installed it gives higher priority to the
$env:SCOOP
variable over the config variable (https://github.com/ScoopInstaller/Scoop/blob/f93028001fbe5c78cc41f59e3814d2ac8e595724/lib/core.ps1#L1259)
So this PR LGTM. Except, if you could, please also read the XDG variable before reading the home directory, so that the behavior is the same as scoop's.
I think this also closes #28 |
Thanks for the review!
I've considered it before. AFAIK the XDG variable is usually available in X, I thought scoop is mostly used in Windows. But you're right, let's keep the behavior the same as scoop's. |
Thanks for the contribution! |
@v1nh1shungry @shilangyu |
Thanks for the report, @eidswe! My guess is you have a config file which may be kind of FYI, I check again the install script, and I find that when installed with |
Yes, config.json doesn't have a field named root_path, the issue has been fixed.Thank you |
The recent version doesn't require defining
SCOOP
to specify the custom install directory. Instead, it's now recommended to use.\install.ps1 -ScoopDir 'D:\Applications\Scoop'
according to https://github.com/ScoopInstaller/Install#advanced-installation. In this way, scoop stores the root path in the config file which is typically 'C:\Users\foobar.config\scoop\config.json`.This patch adds support for reading scoop's config file to get the scoop's root path so users like me don't have to define
SCOOP
to havescoop-search
works.