A cute hack I started adding to my .envrc files:

export PATH=$PWD/scripts:$PATH

Adds project-local scripts to your path when cd'ing into a project directory. example commands I'm currently using:

- `logs` command for tailing cloudwatch logs
- `sql` scripts for dumping csv reports of various kinds

nice UX for project-specific dev scripts. sure they could have just typed ./scripts/logs, but who has time for that. plus direnv can setup deps and api keys.

I guess another benefit is that $PWD will always resolve to the project's root directory. so your scripts will always work no matter what project subdirectory you are in.


for node projects you could do:

export PATH=$(npm bin):$PATH

that way you can use project-local node dev dependencies right away without having to use a runner like npx.

Sign in to participate in the conversation
Bitcoin Mastodon

Bitcoin Maston Instance