Useful software delopment tips for macOS

Jun 28, 2024

This is an ever evolving collection of tips to help with coding software when using macOS. I find myself referring back to these when jumping to a fresh OS install.

mktouch

This is a simple zsh script to help create a blank file, along with any missing folders. This allows for both a file and its folders to be created in a single command:

mktouch() {
  if [ -z "$1" ]; then
    echo "Usage: mktouch <filename>"
    return 1
  fi

  mkdir -p "$(dirname "$1")" && touch "$1"
}

An example usage of this would be:

 mktouch src/muscles/models/_prompts/MuscleModel.tsx.prompt