run using bash & try sudo cp to /usr/local/bin

This commit is contained in:
2024-11-06 13:53:31 +01:00
parent f31ba8542d
commit dbd88d29a8

View File

@@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/bash
export REPO="git@github.com:KevinMidboe/dotfiles"
export DOT_CONFIG_FOLDER="$HOME/.config"
@@ -7,6 +8,7 @@ echo "Cloning github repo"
git clone --depth=1 -b main $REPO $DOT_CONFIG_FOLDER
cd $DOT_CONFIG_FOLDER
git pull origin main
# create symlinks
echo "Creating symlinks"
@@ -15,11 +17,21 @@ ln -s $HOME/.config/wakatime.cfg $HOME/.wakatime.cfg
# copy script files
echo "Copying scripts to /usr/local/bin"
cp scripts/* /usr/local/bin/
cd scripts
if [ $EUID != 0 ]; then
for script in ./*; do
echo " copying $script"
sudo cp $script /usr/local/bin/
done
sudo chmod 755 -R /usr/local/bin/
fi
cd ..
# run install scripts
for script in install/*.sh; do
echo ""
echo "Running install script $script..."
sh "$script"
bash "$script"
done