better install environment

This commit is contained in:
2024-11-06 14:26:40 +01:00
parent b9492f648e
commit 08c1f75051
2 changed files with 9 additions and 7 deletions

View File

@@ -4,23 +4,25 @@ export REPO="git@github.com:KevinMidboe/dotfiles"
export DOT_CONFIG_FOLDER="$HOME/.config" export DOT_CONFIG_FOLDER="$HOME/.config"
# clone dotfiles repo # clone dotfiles repo
echo "Cloning github repo" printf "\n▽ Fetching files.."
git clone --depth=1 -b main $REPO $DOT_CONFIG_FOLDER git clone --depth=1 -b main $REPO $DOT_CONFIG_FOLDER
cd $DOT_CONFIG_FOLDER cd $DOT_CONFIG_FOLDER
git pull origin main git pull origin main
# create symlinks # create symlinks
echo "Creating symlinks" printf "\n▽ Creating symlinks\n"
echo " ▫ .profile"
ln -s $HOME/.config/profile $HOME/.profile ln -s $HOME/.config/profile $HOME/.profile
echo " ▫ .wakatime.cfg"
ln -s $HOME/.config/wakatime.cfg $HOME/.wakatime.cfg ln -s $HOME/.config/wakatime.cfg $HOME/.wakatime.cfg
# copy script files # copy script files
echo "Copying scripts to /usr/local/bin" printf "\n▽ Copying scripts to /usr/local/bin\n"
cd scripts cd scripts
if [ $EUID != 0 ]; then if [ $EUID != 0 ]; then
for script in ./*; do for script in ./*; do
echo " copying $script" echo " copying $script"
sudo cp $script /usr/local/bin/ sudo cp $script /usr/local/bin/
done done
@@ -29,9 +31,9 @@ fi
cd .. cd ..
# run install scripts # run install scripts
printf "\n▽ Running install scripts\n"
for script in install/*.sh; do for script in install/*.sh; do
echo "" printf " ▫ %s\n" $script
echo "Running install script $script..."
bash "$script" bash "$script"
done done

View File

@@ -14,5 +14,5 @@ apps=(
if [ "$(uname)" == "Darwin" ]; then if [ "$(uname)" == "Darwin" ]; then
brew install "${apps[@]}" --cask brew install "${apps[@]}" --cask
else else
echo "skipping cask for non-macos platform" echo "skipping cask for non-macos platform"
fi fi