From 6e0c93760af2ba392c8025e51aeaf49a8a4f7ccd Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Wed, 13 Sep 2023 11:40:42 +0200 Subject: [PATCH] Install `mackup` only on clients Non-clients do not have access to my internal cloud folders => check if one of them exists or not to determine client vs. server --- .local/share/dotfiles/setup.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.local/share/dotfiles/setup.sh b/.local/share/dotfiles/setup.sh index f8b4563..c5f58bd 100755 --- a/.local/share/dotfiles/setup.sh +++ b/.local/share/dotfiles/setup.sh @@ -41,18 +41,22 @@ if _command_exists pip; then # Ensure `pipx` is installed in the user's local environment pip install --upgrade --user pipx - # (Re-)Install `mackup` via `pipx` in the user's local environment - export PIPX_BIN_DIR=$XDG_BIN_HOME - export PIPX_HOME="$XDG_DATA_HOME/pipx" - $XDG_BIN_HOME/pipx uninstall mackup - $XDG_BIN_HOME/pipx install mackup + if [ -d "$HOME/data/getraenkemarkt" ]; then - # Litte Hack: Make `mackup` respect the XDG directory structure - sed -in 's/VERSION = \".*\"/VERSION = \"0.999.0\"/g' $HOME/.local/**/mackup/constants.py - sed -in 's/CUSTOM_APPS_DIR = \"\.mackup\"/CUSTOM_APPS_DIR = \"\.config\/mackup\"/g' $HOME/.local/**/mackup/constants.py - sed -in 's/MACKUP_CONFIG_FILE = \"\.mackup\.cfg\"/MACKUP_CONFIG_FILE = \"\.config\/mackup\/mackup\.cfg\"/g' $HOME/.local/**/mackup/constants.py + # (Re-)Install `mackup` via `pipx` in the user's local environment + export PIPX_BIN_DIR=$XDG_BIN_HOME + export PIPX_HOME="$XDG_DATA_HOME/pipx" + $XDG_BIN_HOME/pipx uninstall mackup + $XDG_BIN_HOME/pipx install mackup - $XDG_BIN_HOME/mackup restore + # Litte Hack: Make `mackup` respect the XDG directory structure + sed -in 's/VERSION = \".*\"/VERSION = \"0.999.0\"/g' $HOME/.local/**/mackup/constants.py + sed -in 's/CUSTOM_APPS_DIR = \"\.mackup\"/CUSTOM_APPS_DIR = \"\.config\/mackup\"/g' $HOME/.local/**/mackup/constants.py + sed -in 's/MACKUP_CONFIG_FILE = \"\.mackup\.cfg\"/MACKUP_CONFIG_FILE = \"\.config\/mackup\/mackup\.cfg\"/g' $HOME/.local/**/mackup/constants.py + + $XDG_BIN_HOME/mackup restore + + fi fi