From ce42ad67d85f81141f42e704e9160cd24f4a10b5 Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.uk>
Date: Tue, 26 Apr 2022 20:57:31 +0100
Subject: [PATCH] fix(dotfiles): clone or update the dotfiles repo

---
 bin/dotfiles | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/dotfiles b/bin/dotfiles
index bdd5dce7..834e27ea 100755
--- a/bin/dotfiles
+++ b/bin/dotfiles
@@ -7,7 +7,11 @@ DOTFILES_DIR="$HOME/.dotfiles"
 PATH="${PATH}:${HOME}/.local/bin"
 
 clone_or_update_dotfiles() {
-  git -C $DOTFILES_DIR pull
+  if ! [[ -d "$DOTFILES_DIR" ]]; then
+    git clone "https://github.com/opdavies/dotfiles.git" "$DOTFILES_DIR"
+  else
+    git -C "$DOTFILES_DIR" pull
+  fi
 }
 
 create_config_dir() {