google / woff2

MIT License
1.49k stars 181 forks source link

In Readme, not obvious how to ensure binaries are in $PATH #131

Open arrowtype opened 4 years ago

arrowtype commented 4 years ago

In the past, I've installed this through homebrew, but I'm trying to follow the Readme instructions this time around. The make process is very simple, but I am stuck at this advice:

Ensure the binaries from the build process are in your $PATH

How does one do this? Is there more information we might give people about the probably paths of the binaries created? It isn't made obvious in the output of the makefile (at least not to me).

My current guess is that I should update my PATH in ~/.bash_profile to be something like this:

PATH="$PATH:/Users/stephennixon/woff2/woff2_compress:/Users/stephennixon/woff2/woff2_decompress:/Users/stephennixon/woff2/woff2_info:/Library/Frameworks/Python.framework/Versions/3.8/bin"
export PATH

I realize that the exact instructions may vary from person to person, but I hoping there might be slightly more we could say about this step?

If anyone sees this who happens to have advice on this, I would be very appreciative! If I figure it out first, I will try to update this and perhaps make a PR.

Thank you!

arrowtype commented 4 years ago

Ah, it was slightly simpler.

I had to add /Users/stephennixon/woff2 to my PATH variable, so that the three commands in that directory could be called. It makes more sense, now. :)

PATH="$PATH:/Users/stephennixon/woff2:/Library/Frameworks/Python.framework/Versions/3.8/bin"
export PATH

UPDATE: to clarify, I only added /Users/stephennixon/woff2 to the PATH variable, and then there is another path added for Python. The two are separated with :. Quoting from man bash docs to define what the PATH variable does: "An attempt is first made to open the file in the current directory, and, if no file is found, then the shell searches the directories in PATH for the script." So, basically, when we point to the command woff2_compress, the woff2 directory must be in the PATH variable for it to be possible to run.

koitaki commented 2 years ago

For WSL, after cloning the repo in home/projects I did:

PATH="$PATH:/home/user/projects/woff2"
export PATH