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

support reading scoop home from the config file #30

Merged
merged 1 commit into from
Jan 25, 2023
Merged

support reading scoop home from the config file #30

merged 1 commit into from
Jan 25, 2023

Conversation

v1nh1shungry
Copy link
Contributor

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 have scoop-search works.

Copy link
Owner

@shilangyu shilangyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my reference:

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.

@shilangyu
Copy link
Owner

I think this also closes #28

@v1nh1shungry
Copy link
Contributor Author

Thanks for the review!

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'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.

@shilangyu
Copy link
Owner

Thanks for the contribution!

@shilangyu shilangyu linked an issue Jan 25, 2023 that may be closed by this pull request
@shilangyu shilangyu merged commit 551b20b into shilangyu:master Jan 25, 2023
@shilangyu
Copy link
Owner

@eidswe
Copy link

eidswe commented Jan 25, 2023

@v1nh1shungry @shilangyu
Unable to use scoop-search after update, encountered the same problem as #31

@v1nh1shungry
Copy link
Contributor Author

Thanks for the report, @eidswe!

My guess is you have a config file which may be kind of C:\Users\eidswe\.config\scoop\config.json, but it doesn't have a field named root_path. Could you please check this? Thanks!

FYI, I check again the install script, and I find that when installed with SCOOP specified or the install directory is the default value, the installation won't write the root path.

@eidswe
Copy link

eidswe commented Jan 26, 2023

Yes, config.json doesn't have a field named root_path, the issue has been fixed.Thank you

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.

Don't work if SCOOP not a variable in your environment
3 participants