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

SFSU uses "legacy" method for locating custom Scoop installation #180

Closed
mizzuri opened this issue Apr 23, 2023 · 5 comments · Fixed by #188
Closed

SFSU uses "legacy" method for locating custom Scoop installation #180

mizzuri opened this issue Apr 23, 2023 · 5 comments · Fixed by #188
Assignees
Labels
enhancement New feature or request

Comments

@mizzuri
Copy link

mizzuri commented Apr 23, 2023

Describe the bug
sfsu commands, such as search and list, cannot be run without it showing an error, when scoop is installed at a custom location. e.g. scoop installed at P: and not at ~/scoop.

To Reproduce
Steps to reproduce the behavior:

  1. Install scoop at another drive letter other than its default location, i.e. ~/scoop
  2. Install sfsu
  3. Run sfsu list
  4. See error

Expected behavior
sfsu list should successfully return with installed packages.

Full Output
> sfsu list
thread 'main' panicked at 'Scoop path does not exist', src\main.rs:51:9

Version [e.g. 1.4.7]

Additional context
I thought this issue would've been fixed by #11.
I'm not a dev, so please excuse me if I'm incorrect.

@mizzuri mizzuri added the bug Something isn't working label Apr 23, 2023
@jewlexx
Copy link
Member

jewlexx commented May 2, 2023

Hey, sorry for the late response, How have you set the custom directory? I have had scoop set in a custom directory for ages and it has never been an issue for me.

@mizzuri
Copy link
Author

mizzuri commented May 3, 2023

First, I uninstalled scoop, which was installed at ~/scoop, using the directions given here.

Then, I installed again, but this time to a custom directory as followed (source):

  • irm get.scoop.sh -outfile 'install.ps1
  • .\install.ps1 -ScoopDir 'P:\scoops\scoop' -ScoopGlobalDir 'P:\scoops\globalscoops'

And thank you for this utility. I hope sfsu replaces scoop's original search soon.

Edit: On Windows 11 (21H2)
Edit2: Windows is installed at C:. P: is at a separate drive.

@jewlexx
Copy link
Member

jewlexx commented May 3, 2023

Ah, yeah generally the way to change Scoop's install dir is via the SCOOP and SCOOP_GLOBAL environment variables respectively. This is how sfsu detects the install directory, and the Scoop install script detects these as well.

I probably could add support for the arguments passed to the install script, but I'm not sure where I'd start and the environment variable solution is what is mentioned in the docs, and what most people are using. Also implementing another solution for another edge case would add more overhead to startup that I don't really want.

I'd suggest using this as well, don't worry about uninstalling scoop again, but you can just set the environment variables to their respective directories, and everything should work fine.

If for any reaason you can't use the env variable solution, let me know and I'll work on implementing the other way.

@mizzuri
Copy link
Author

mizzuri commented May 3, 2023

Now, I see. I didn't go the route of using environment variables, because the scoop doc says it's a "legacy method" and "not recommended".

Anyhow.. I'll just use the environment variables.
Thanks for the prompt response and keep up the good work!

Edit: Some how, I can't remove the label "bug" for this issue, because obviously this is not a bug.

@mizzuri mizzuri closed this as completed May 3, 2023
@jewlexx
Copy link
Member

jewlexx commented May 4, 2023

Huh, honestly didn't realise it was considered "legacy".

I'll see if I can work on supporting the new method.

Edit: Some how, I can't remove the label "bug" for this issue, because obviously this is not a bug.

I believe only maintainers can edit issue labels

@jewlexx jewlexx reopened this May 4, 2023
@jewlexx jewlexx added enhancement New feature or request and removed bug Something isn't working labels May 4, 2023
@jewlexx jewlexx changed the title Error shown when scoop is not installed at the default location SFSU uses "legacy" method for locating custom Scoop installation May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants