scripts(install): add support for installing files from directory

This commit is contained in:
retrozinndev
2025-05-15 16:37:04 -03:00
parent 8fcbc248bb
commit 4b7bdfde8a
+8 -3
View File
@@ -45,7 +45,7 @@ echo "Welcome to the colorshell installation script!"
echo "!!!WARNING!!! By running this script, you assume total responsability for any issues that may occur with your filesystem"
echo -n "Do you want to start the shell installation? [y/n] "
[[ ! $1 == "dots" ]] && read input
[[ ! $1 == "dots" ]] && read input || printf "\n"
if [[ $1 == "dots" ]] || [[ $input =~ "y" ]]; then
Send_log "Starting installation...\n"
@@ -54,8 +54,13 @@ if [[ $1 == "dots" ]] || [[ $input =~ "y" ]]; then
dest=$XDG_CONFIG_HOME/$dir
echo "-> Installing $dir in $dest"
mkdir -p $dest
cp -rf ./$dir/* $dest
if [[ -f "./$dir" ]]; then
mkdir -p $dest # create parents
rm -f $dest # delete unused directory
cp -f ./$dir # copy actual file
else
cp -rf ./$dir/* $dest # force-copy content
fi
done
# Ask if user also wants to install default wallpapers