Skip to content
Dan Croak edited this page Apr 24, 2017 · 4 revisions

Put your personal customizations in ~/.laptop.local. Write your customizations such that they can be run safely more than once.

brew_install_or_upgrade, fancy_echo and other functions from mac are available for use in ~/.laptop.local.

Below are some example functions written by the community.

Git

git_clone_or_pull() {
  local REPOSRC=$1
  local LOCALREPO=$2
  local LOCALREPO_VC_DIR=$LOCALREPO/.git
  if [[ ! -d "$LOCALREPO_VC_DIR" ]]; then
    git clone --recursive $REPOSRC $LOCALREPO
  else
    pushd $LOCALREPO
    git pull $REPOSRC && git submodule update --init --recursive
    popd
  fi
}
Clone this wiki locally