]> apps.delaporte.us Git - dotfiles.git/blobdiff - bin/dot
Add error catch to install/.sh
[dotfiles.git] / bin / dot
diff --git a/bin/dot b/bin/dot
index dc3e8fa2e8114be4a85f5115f8d013bdd6efc47b..d816767e1b39205b6980eb7faf91e9f632ca8450 100755 (executable)
--- a/bin/dot
+++ b/bin/dot
@@ -9,6 +9,8 @@ INSTALLS="$DOTFILES/install"  # Install scripts
 DOT="$HOME/.dot"  # Touched files go here to track installs
 REQS="$DOTFILES/reqs"  # Python env requirements.txt files
 
 DOT="$HOME/.dot"  # Touched files go here to track installs
 REQS="$DOTFILES/reqs"  # Python env requirements.txt files
 
+mkdir -p "$DOT"
+
 read -d '' HELP << EOF
 dot - a (mostly) one script dotfiles manager
 
 read -d '' HELP << EOF
 dot - a (mostly) one script dotfiles manager
 
@@ -164,7 +166,7 @@ if [ "$1" == "apply" ]; then
                echo "$TASKFILE is missing. Run 'dot setup'"
                exit 1
        fi
                echo "$TASKFILE is missing. Run 'dot setup'"
                exit 1
        fi
-       $ANSIBLE $TASKFILE
+       $ANSIBLE -v $TASKFILE
 fi
 
 if [ "$1" == "install" ]; then
 fi
 
 if [ "$1" == "install" ]; then
@@ -188,8 +190,12 @@ read -d '' RUN_INSTALL << EOF
       register: $2_installed
     - name: install $2
       ansible.builtin.shell: |
       register: $2_installed
     - name: install $2
       ansible.builtin.shell: |
-        "$INSTALLS/$2.sh"
-        touch "$DOT/$2.installed"
+        "$INSTALLS/$2.sh" && touch "$DOT/$2.installed"
+      register: ret
+      failed_when: >
+          ("Error" in ret.stdout) or
+          (ret.stderr != '') or
+          (ret.rc != 10)
       when: not $2_installed.stat.exists
     - name: verify $2 is installed
       ansible.builtin.debug:
       when: not $2_installed.stat.exists
     - name: verify $2 is installed
       ansible.builtin.debug: