From 0a9e69c41db22b8f795122736a415e89a8eb3235 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Sun, 5 Jun 2022 20:29:00 +0200 Subject: [PATCH] Add check for firefox directory itself --- arch-config/scripts/arch-config.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/arch-config/scripts/arch-config.sh b/arch-config/scripts/arch-config.sh index aa99fecf..272317ad 100755 --- a/arch-config/scripts/arch-config.sh +++ b/arch-config/scripts/arch-config.sh @@ -204,10 +204,15 @@ EOF cp -r ~/config/.config/ ~/ cp -r ~/config/.local/ ~/ #cp -r ~/config/Dokumente ~/ -# NOTE check if firefox default-release directory exists. 1 is good, 0 is bad -firefoxdir=$(find ~/.mozilla/firefox/ -name \*.default-release | wc -l) -if [[ $firefoxdir -eq 1 ]]; then - cp -r ~/config/.mozilla/firefox/default-release/* ~/.mozilla/firefox/*.default-release/ +# NOTE find fails if the top level directory is not found +if [[ -d ~/.mozilla/firefox ]]; then + # NOTE check if firefox default-release directory exists. 1 is good, 0 is bad + firefoxdir=$(find ~/.mozilla/firefox/ -name \*.default-release | wc -l) + if [[ $firefoxdir -eq 1 ]]; then + cp -r ~/config/.mozilla/firefox/default-release/* ~/.mozilla/firefox/*.default-release/ + else + echo "Please launch firefox and then update the config again" + fi else echo "Please launch firefox and then update the config again" fi