Scoop
Scoop copied to clipboard
Shims for relative paths
Hi.
Can we have a possibility to specify relative paths in shims? Like this:
path = ../apps/<app>/current/app.exe
That will allow users to simply move 'scoop' folder from machine to machine or from user to user. Now we have absolute paths, and this is not much useful.
I've remembered another reason. Making paths relative will allow users to prepare software bundles in order to run in some isolated environments. For example, I want to run some tools in another computer without Internet, and I simply copy scoop
folder using a flash drive (and add shims
to PATH
).
I would not mind any reason to keep them absolute though. Personally, I think it is more handy to get rid of absolute paths where it is possible.
Hi. What do you think about this change?
Sorry for the late review.
There is no need to call GetDirectoryName()
and GetExecutingAssembly()
because the results are already available from line 67-69.
https://github.com/lukesampson/scoop/blob/0215c7bc0b3ce542162f078b4cf303238ae719b7/supporting/shimexe/shim.cs#L67-L69
Therefore it's enough to call the following:
if (!System.IO.Path.IsPathRooted(path)) {
// allow relative path to exe
path = Path.Combine(dir, path);
}
This requires changes to shim()
to function.
I think it's better to introduce a environment variable substitution here instead of fixed relative paths.
Also it's upset the PR is not reviewed for years.