Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

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

Open pratikpc opened this issue 4 years ago • 2 comments

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.

pratikpc avatar Nov 06 '21 16:11 pratikpc

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 avatar Dec 05 '21 21:12 hgkamath

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

hgkamath avatar Dec 06 '21 06:12 hgkamath