From 17dcdb938f427966cf8c0f0827417a98fca001d1 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 6 Jul 2026 07:07:44 -0500 Subject: [PATCH 1/1] Fix for ability to create corrupt .yaml --- bin/dot | 11 ++++++----- files/{pc => }/bashrc | 0 2 files changed, 6 insertions(+), 5 deletions(-) rename files/{pc => }/bashrc (100%) diff --git a/bin/dot b/bin/dot index d99ef6e..312dd4a 100755 --- a/bin/dot +++ b/bin/dot @@ -35,7 +35,7 @@ if [ ! -n "$1" ] || [ "$1" == "help" ]; then fi # set -v -TASKFILE="$HOME/dot.$HOSTNAME.yaml" +TASKFILE="$HOME/backup/dot.$HOSTNAME.yaml" LINKFILES="$HOME/dotfiles/files" INSTALLS="$HOME/dotfiles/install" DOT="$HOME/dot" @@ -53,6 +53,11 @@ read -d '' EMPTY_TASKFILE << EOF path: $TASKFILE EOF +if [[ ! -f "$TASKFILE" ]]; then + echo "Creating empty $TASKFILE" + mkdir -p "$HOME/backup" + echo "$EMPTY_TASKFILE" >> $TASKFILE +fi if [ "$1" == "setup" ]; then if [[ ! -f "$ANSIBLE" ]]; then @@ -64,10 +69,6 @@ if [ "$1" == "setup" ]; then if [[ -f "$ANSIBLE" ]]; then echo "[ ok ]: Ansible setup at $ANSIBLE" fi - if [[ ! -f "$TASKFILE" ]]; then - echo "Creating $TASKFILE" - echo "$EMPTY_TASKFILE" >> $TASKFILE - fi if [[ -f "$TASKFILE" ]]; then echo "[ ok ]: dot config at $TASKFILE" fi diff --git a/files/pc/bashrc b/files/bashrc similarity index 100% rename from files/pc/bashrc rename to files/bashrc -- 2.47.3