]> us-delaporte.pagekite.me Git - dotfiles.git/blobdiff - bin/dot
Update install to check installs
[dotfiles.git] / bin / dot
diff --git a/bin/dot b/bin/dot
index 45a7a393824a3186bb40c3216a71ebf0806e0fe9..0fd7dd78094f0f527a965d595f1f8dcc6c7b1f29 100755 (executable)
--- a/bin/dot
+++ b/bin/dot
@@ -26,6 +26,7 @@ ENVS="$HOME/envs"
 ANSIBLE="$ENVS/ansible/bin/ansible-playbook"
 TASKFILE="$HOME/dot.$HOSTNAME.yaml"
 LINKFILES="$HOME/dotfiles/files"
+INSTALLS="$HOME/dotfiles/install"
 
 read -d '' EMPTY_TASKFILE << EOF
 ---
@@ -85,7 +86,7 @@ if [ "$1" == "link" ]; then
 
 read -d '' LINK_THIS_FILE << EOF
 
-    - name: Create a symbolic link
+    - name: symlink $2
       ansible.builtin.file:
         src: "$LINKFILES/$2"
         dest: "$HOME/.$2"
@@ -94,6 +95,26 @@ EOF
 
        echo "    $LINK_THIS_FILE" >> $TASKFILE
        echo "$2 added to symlinks in $TASKFILE"
-       echo "Run `dot apply` to create all configured symlinks"
+       echo "Run 'dot apply' to create all configured symlinks"
 fi
 
+
+if [ "$1" == "apply" ]; then
+  if [[ ! -f "$TASKFILE" ]]; then
+               echo "$TASKFILE is missing. Run 'dot setup'"
+               exit 1
+       fi
+       $ANSIBLE $TASKFILE
+fi
+
+if [ "$1" == "install" ]; then
+       if [ ! -n "$2" ]; then
+               echo "Can install:"
+               cd $INSTALLS
+               ls -p | grep -v /
+               exit 1
+       fi
+       $INSTALLS/$2
+fi
+
+