Skip to content

Instantly share code, notes, and snippets.

@steeef
Last active March 21, 2023 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steeef/2cf6345055bdec2c9b8781267e8299ab to your computer and use it in GitHub Desktop.
Save steeef/2cf6345055bdec2c9b8781267e8299ab to your computer and use it in GitHub Desktop.
bootstrap my dotfiles
#!/usr/bin/env bash
#
# to install:
# curl -sL https://gist.githubusercontent.com/steeef/2cf6345055bdec2c9b8781267e8299ab/raw/download_and_bootstrap.sh | bash -ex
REPO="https://github.com/steeef/dotfiles"
LOCALDIR="${HOME}/.dotfiles"
if command -v git >/dev/null 2>&1; then
mkdir -p "${LOCALDIR}"
if (cd "${LOCALDIR}" && git rev-parse --git-dir); then
git -C "${LOCALDIR}" pull
else
rm -rf "${LOCALDIR}"
git clone "${REPO}" "${LOCALDIR}"
fi
"${LOCALDIR}/bin/bootstrap.sh"
else
echo "ERROR: git command not found."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment