From 4a8cdc88aefc2cd46381659e62dfd9b8c44dd133 Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Wed, 3 Jan 2024 02:32:33 -0500 Subject: [PATCH] split copy and link so it can be used separately --- scripts/copy_and_link | 24 ++++++++++++++++++++++++ setup | 29 ++++------------------------- 2 files changed, 28 insertions(+), 25 deletions(-) create mode 100755 scripts/copy_and_link diff --git a/scripts/copy_and_link b/scripts/copy_and_link new file mode 100755 index 0000000..74b2bf5 --- /dev/null +++ b/scripts/copy_and_link @@ -0,0 +1,24 @@ +#!/bin/sh + +# Copy configs and make a backup if it already exists +echo -e "\nInstalling Configs..." + for file in configs/* + do + echo -e "\n$file..." + cp -rbv $file $HOME/.config/ + done + +# Copy scripts and make a backup if it already exists +echo -e "\nInstalling Scripts..." + +if [ ! -d "$HOME/.local/bin" ]; then + mkdir "$HOME/.local/bin" +fi + +cp -rbv bin $HOME/.local + +# Link shell files and make a backup if it already exists +echo -e "\nLinking shell..." + cp -sbv $HOME/.config/shell/profile ~/.zprofile + cp -sbv $HOME/.config/x11/xinitrc ~/.xinitrc + diff --git a/setup b/setup index 8f9b762..a1af530 100755 --- a/setup +++ b/setup @@ -68,33 +68,12 @@ else fi # Init and update awesome widgets submodule -cd $HOME/.doors +cd $HOME/.doors && git submodule init && git submodule update -# Copy configs and make a backup if it already exists -echo -e "\nInstalling Configs..." - cd $HOME/.doors/configs - - for file in * - do - echo -e "\n$file..." - cp -rbv $file $HOME/.config/ - done - -# Link shell files and make a backup if it already exists -echo -e "\nLinking shell..." - cp -sbv $HOME/.config/shell/profile ~/.zprofile - cp -sbv $HOME/.config/x11/xinitrc ~/.xinitrc - -# Copy scripts and make a backup if it already exists -echo -e "\nInstalling Scripts..." - cd $HOME/.doors - - if [ ! -d "$HOME/.local/bin" ]; then - mkdir "$HOME/.local/bin" - fi - - cp -rbv bin $HOME/.local +# Copy and link files +cd $HOME/.doors && +$HOME/.doors/scripts/copy_and_link # Wrap up echo -e "\nDone!\nLog out and back in for changes to take effect."