From 200733b43c861f525d3c0c2e319f87e260b18a11 Mon Sep 17 00:00:00 2001 From: CrimsonTome Date: Wed, 23 Nov 2022 00:24:57 +0000 Subject: [PATCH] chore: mv config setup to function --- post-install | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/post-install b/post-install index 808f888..c383ea8 100755 --- a/post-install +++ b/post-install @@ -41,22 +41,37 @@ if [[ $os == "Ubuntu" ]]; then cat snap-packages| xargs -n 1 sudo snap install --classic; wget https://dl.discordapp.net/apps/linux/0.0.21/discord-0.0.21.deb; sudo apt install ./discord-0.0.21.deb; - git clone https://github.com/crimsontome/config; - cp -f config/bin/* $userBinDir; - cp -f config/ub-server/.bashrc ~/; - cp -f config/.gitconfig ~/; - cp -f config/.ssh/config $sshDir/config + setup_config $os; elif [[ $os == "Fedora" ]]; then echo "dnf is not yet supported"; - exit; + setup_config $os; elif [[ $os == "Arch" ]]; then echo "pacman is not yet supported"; - exit; + setup_config $os; else - echo "OS not yet supported"; - exit; + echo "OS package manager is not yet supported"; + fi +setup_config() +{ + + git clone https://github.com/crimsontome/config; + cp -f config/bin/* $userBinDir; + if [[ $os == "Ubuntu" ]]; then + cp -f config/ub-server/.bashrc ~/; + elif [[ $os == "Fedora" ]]; then + cp -f config/fedora/.bashrc ~/; + elif [[ $os == "Arch" ]]; then + cp -f config/arch/.bashrc ~/; + else + echo "OS specific bashrc not yet supported"; + exit; + fi + cp -f config/.gitconfig ~/; + cp -f config/.ssh/config $sshDir/config +} + cd $gitdir; gh auth login; # after logged into gh