Make updating firefox config optional

This commit is contained in:
RealStickman 2023-05-22 21:16:01 +02:00
parent 6a0dfeba25
commit 1bde1df151

View File

@ -76,14 +76,19 @@ fi
#### Arguments ####
####################
copy_firefox=0
# handle arguments
if [[ "$#" -eq 1 ]]; then
# -t/--theme to change theme
if [[ "$1" == "-t" || "$1" == "--theme" ]]; then
func_seltheme
elif [[ "$1" == "-f" || "$1" == "--firefox" ]]; then
copy_firefox=1
elif [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "-h, --help Show help menu"
echo "-t, --theme Show theme selection screen"
echo "-f, --firefox Update firefox config"
fi
elif [[ "$#" -gt 1 ]]; then
echo "Too many arguments"
@ -229,7 +234,10 @@ cp -r ~/configs/arch-config/.local/ ~/
#cp -r ~/config/.elvish ~/
cp -r ~/configs/arch-config/.doom.d ~/
cp -r ~/configs/arch-config/.ssh ~/
if [[ -d ~/.mozilla/firefox ]]; then
# copy firefox only if "-f" or "--firefox" is given as argument
if [[ copy_firefox -eq 1 ]]; then
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
@ -237,9 +245,11 @@ if [[ -d ~/.mozilla/firefox ]]; then
else
echo "Please launch firefox and then update the config again"
fi
else
else
echo "Please launch firefox and then update the config again"
fi
fi
echo Copied folders
#copy single files