-
-
Save rosszurowski/eee05cebb67fd869b7db1914b844db9c to your computer and use it in GitHub Desktop.
Modifying $PATH in Make on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can, in fact reference node_modules without the prefix by prepending node_modules to your $PATH with this line: | |
export PATH := ./node_modules/.bin:$(PATH) | |
# But for some reason, on macOS, Make doesn’t recognize the $PATH when it’s the start of a command. | |
# So this rule doesn’t work. It treats `prettier` as a file/directory: | |
format: node_modules | |
@prettier --write . | |
# But this rule does: | |
format: node_modules | |
@true && prettier --write . | |
# Erring on the side of simplicity and clarity, it's probably best to just include the full prefix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oo interesting. This is the top of the Makefile I ran:
I'm using stock make, but a bit older