From dbd88d29a8b56acd3108bd57e86b29da7b5b99f4 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Wed, 6 Nov 2024 13:53:31 +0100 Subject: [PATCH] run using bash & try sudo cp to /usr/local/bin --- install.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 9351a2a..065e29e 100644 --- a/install.sh +++ b/install.sh @@ -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