zap icon indicating copy to clipboard operation
zap copied to clipboard

use --directory-prefix=

Open Goddard opened this issue 2 years ago • 4 comments

use --directory-prefix= in case the directory path doesn't exist

Goddard avatar Jul 18 '21 14:07 Goddard

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/srevinsaju/zap/HReZgiUejJTp2FEmcNBj5EZLyENR
✅ Preview: https://zap-git-fork-goddard-patch-1-srevinsaju.vercel.app

vercel[bot] avatar Jul 18 '21 14:07 vercel[bot]

But... --directory-prefix just creates the directory, right? Here, we are also overriding the file name.

Right now.. if this command is executed by a user:

  1. ~/.local/bin/zap directory will be created
  2. The zap-amd64 file will be placed in ~/.local/bin/zap/., so the net resulting path of the binary would be ~/.local/bin/zap/zap-amd64. However, most $PATH definitions on linux only adds ~/.local/bin to $PATH, and that means, the user won't be able to invoke zap using its endpoint, zap right? and even if ~/.local/bin/zap/. was added to $PATH, user would have to use zap-amd64 to invoke zap instead of just zap.

srevinsaju avatar Jul 18 '21 14:07 srevinsaju

I added a commit https://github.com/srevinsaju/zap/commit/279370c92e8beda67e14841c5a7e8c94eeb51d38 to make it more intuitive. Now it additionally, creates the directories. Let me know if you have a better solution :smile:

srevinsaju avatar Jul 18 '21 14:07 srevinsaju

yeah that definitely works. I just didn't want to make it multiple commands.

Also I think the instructions tell people to run command zap, but the binary downloaded is zap-amd64. So it either needs to add some kind of alias, or something.

Another problem is that the binary folder isn't actually in the $PATH on my machine.

Goddard avatar Jul 18 '21 15:07 Goddard