SupportExamples

Examples

Dotfiles blocks used by the Fig team.


Create a temporary directory for testing

Most developers have a testing directory somewhere - but did you know that your OS actually cleans up /tmp automatically? You can combine mktemp with cd to quickly create scratch-directories that you won't ever need again!

A function dotfile block containing the code 'cd "$(mktemp -d)"'


Add your current directory to your path

If you use NPM a lot, you're probably using npx to run scripts in your ./node_modules/bin folder. You can actually add that dynamically to your $PATH!

Two path dotfile blocks, one containing '.' and one containing './node_modules/bin'