aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Singleton <matt@xcolour.net>2022-04-21 08:21:28 -0500
committerMatt Singleton <matt@xcolour.net>2022-04-21 08:21:28 -0500
commit67b5c0aa428259197e8c814d75748427ba64e83e (patch)
treed2460357c500998c84ef7d84788493569953a904
parentb4dd9917af961d22bdcfefd701f93178e467e3a3 (diff)
rearranging the deck chairs
-rwxr-xr-xdeploy.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/deploy.sh b/deploy.sh
index 632739b..81b4989 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -2,8 +2,6 @@
set -eo pipefail
-mkdir -p dotfiles-backup
-
if command -v unzip > /dev/null; then
UNZIPCMD="unzip"
fi
@@ -20,6 +18,8 @@ if [ -z "$UNZIPCMD" ] || [ -z "$VIMCMD" ] || [ -z "$DLCMD" ]; then
exit 1
fi
+set -u
+
# XDG layout
xcache="${XDG_CACHE_HOME:-${HOME}/.cache}"
xdata="${XDG_DATA_HOME:-${HOME}/.local/share}"
@@ -33,6 +33,7 @@ function link {
src="$1"
dest="$2"
if [ -e "$dest" ] && [ ! -L "$dest" ]; then
+ mkdir -p "../dotfiles-backup"
mv "$dest" "../dotfiles-backup/."
fi
if [ ! -e "$dest" ]; then