From c9a945559d51b2cb5f69eabca993ed4a5025a1d3 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Wed, 1 Nov 2023 11:41:53 +1100 Subject: [PATCH] Add capacity for multiple supported Stow versions --- dot-local/bin/dots | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dot-local/bin/dots b/dot-local/bin/dots index b288f1c..996e03f 100755 --- a/dot-local/bin/dots +++ b/dot-local/bin/dots @@ -11,17 +11,23 @@ global_ignore=( '\..*\.swp' ) +supported_stow_versions=( + 2.3.2-fixbug56727 +) + bootstrap() { echo 'Bootstrapping your dotfiles...' >&2 mkdir -p $DOTFILES touch $DOTFILES/.stow if (( $+commands[stow] )); then local stow_version=${"$(stow -V)"#stow*version } - if [[ $stow_version != 2.3.2-fixbug56727 ]]; then + if (( 0 == $supported_stow_versions[(Ie)$stow_version] )); then echo "GNU Stow is installed, but version $stow_version is bugged." >&2 echo 'See https://github.com/aspiers/stow/issues/33 for info.' >&2 echo 'Will fetch patched version of Stow...' >&2 install-custom-gnu-stow || return $? + else + echo "GNU Stow version $stow_version is installed and is compatible with dots." >&2 fi else echo 'GNU Stow is not installed, fetching it...' >&2