71 / scoop-better-shimexe

A better shim.exe file for Scoop.
MIT License
72 stars 29 forks source link

Support resolving shim's directory in the path and args #10

Closed felipecrs closed 3 years ago

felipecrs commented 3 years ago

In my use case, I want to use this shim.exe to launch a JavaScript application through Node.js, so something like:

path = node.exe
args = ./cli.js

But since it does not support resolving directories relative to the shim's root, I'm not able to use it, because I'll not have control about where NPM will put my cli.js, only that it will be beside the shim.exe.

felipecrs commented 3 years ago

So, my suggestion is:

path = node.exe
args = %~dp0\cli.js

And then, when loading the .shim, replace any occurrences of %~dp0 with the shim's directory. I used %~dp0 in this example because it's what is used in .bat scripts.

The problem is: I have no clue how to implement.

71 commented 3 years ago

This is a good idea, but since this repo is intended to be minimal and Scoop doesn't mention such a feature, I'd rather not implement it. I think it would be best to implement this on @kiennq's fork, like you did.