From: Edward Delaporte Date: Mon, 6 Jul 2026 03:30:04 +0000 (-0500) Subject: Add help text to dot link X-Git-Url: https://apps.delaporte.us/gitweb/dotfiles.git/commitdiff_plain/254e6af15bf3d9241f9d44b51e997537ecfd90f4?ds=sidebyside Add help text to dot link --- diff --git a/bin/dot b/bin/dot index 16e366e..4e21e72 100755 --- a/bin/dot +++ b/bin/dot @@ -36,8 +36,8 @@ read -d '' EMPTY_TASKFILE << EOF connection: local tasks: - - name: Do nothing - ansible.builtin.shell: echo "Nothing to do." + - name: Do nothing + ansible.builtin.shell: echo "Nothing to do." EOF @@ -60,6 +60,16 @@ if [ "$1" == "setup" ]; then fi fi +if [ "$1" == "reset" ]; then + read -n1 -p "Reset $TASKFILE? [y,N]" input + if [[ ! $input == "Y" && ! $input == "y" ]]; then + echo "Aborted by user" + exit 1 + fi + echo "$EMPTY_TASKFILE" > $TASKFILE +fi + + if [ "$1" == "check" ]; then $ANSIBLE $TASKFILE --check --diff fi @@ -72,28 +82,26 @@ fi -if [ "$1" == "link" ]; then - echo "wait" -fi -echo << EOF -- name: Create a symbolic link - ansible.builtin.file: - src: /file/to/link/to - dest: /path/to/symlink - owner: foo - group: foo - state: link -EOF -echo "heh" +if [ "$1" == "link" ]; then + if [ ! -n "$2" ]; then + echo "May symlink:" + cd $HOME/dotfiles/files + ls -p | grep -v / + fi +read -d '' LINK_FILE << EOF +--- + tasks: + - name: Create a symbolic link + ansible.builtin.file: + src: /file/to/link/to + dest: /path/to/symlink + owner: foo + group: foo + state: link +EOF -if [ "$1" == "reset" ]; then - read -n1 -p "Reset $TASKFILE? [y,N]" input - if [[ ! $input == "Y" && ! $input == "y" ]]; then - echo "Aborted by user" - exit 1 - fi - echo "$EMPTY_TASKFILE" > $TASKFILE fi +