Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One important tip is that the commands under a target each run sequentially, but in separate shells. So if you went to set env vars, cd, activate a Python virtualenv, etc to affect the next command, you need to make them a single command, like:

  target:
      cd ./dir; ./script.sh


    cd dir && \
        ./script.sh && \
        ./otherstuff.sh
handles errors, in case `dir` doesn't exist for example.


There's .ONESHELL for that (as long as we are talking about GNU Make)




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: