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

Making it possible to store Scoop config in the root directory for increased portability. #4498

Closed
pratikpc opened this issue Nov 6, 2021 · 2 comments · Fixed by #5424
Closed

Comments

@pratikpc
Copy link
Contributor

pratikpc commented Nov 6, 2021

Current behaviour is to save at ~/.config/scoop/config.json.

Could we add an optional behaviour that if a user creates a config.json file in the root directory, then Scoop would prioritise that over the Scoop present in ~/.config/scoop/config.json.

If absent, ~/.config/scoop/config.json is used by default.

This would probably make Scoop a bit more portable and for most users would make it possible to copy paste Scoop from one directory to another or one system to another or one user to another without facing major issues.

@hgkamath
Copy link

hgkamath commented Dec 5, 2021

Use cases:

  1. dual-boot windows-s installations cooperatively sharing a scoop-installation on a partition
  2. Virtual Machines cooperatively sharing scoop-installation on a mounted virtual/network disk
  3. Network Machines cooperatively sharing scoop-installation on a mounted network share
  4. USB thumb drive

--
It may not always be easy to reboot and login into the original scoop-managing-admin of other winOS, or VM or NetworkPC to do scoop management.

How about a SCOOP_CONFIG_DIR environment variable pointing to wherever .../scoop folder containing config.json is
and if the environment variable pointing to config does not exist then fall back to the hard-coded directory $HOME\.config\scoop.

...
I was looking at the config file. All it contains is git info (URL,branch) and last update time stamp. I read in the docs, it is also used to store proxy information, suppress aria2 warnings.

As OP mentioned, if that is all its purpose why not keep with rest of scoop user-packages in a sibling directory or subfolder of scoop-managing-admin's SCOOP directory root. When scoop is invoked as global "-g", same file associated with User's SCOOP directory is used is consulted. I think the environment variable method would then allow each scoop-managing-admin to configure their own proxy.

note: to use scoop portably

  1. As the user who installed SCOOP, admin user already has env var SCOOP and PATH has scoop/shims directory
  2. configure env var SCOOP_GLOBAL
  3. add to Global env var PATH, the shim directory under $env:SCOOP_GLOBAL
  4. Always install the scoop apps that are to be shared using scoop install -g

--
but for a different scoop-managing-admin on diifferent booted winOS, to upgrade scoop apps, one should additionally

  1. Ensure the SCOOP root directory is also accessible for the scoop command
  2. configure env-var SCOOP
  3. have access to config directory of scoop-managing-admin on different winos partition and also set the env-var PATH to have SCOOP/shims directory

--
.. If partition of original scoop-managing-admin is accessible, one may temporarily set the HOME env-var (not-tried) but this may not work for VMs.

@hgkamath
Copy link

hgkamath commented Dec 6, 2021

Scoop windows start-menu shortcuts may also require recreation/resyncingfor increased portability #4562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants