Update deploy.sh

This commit is contained in:
Marko Korhonen 2020-11-21 15:36:35 +02:00
parent 0bb307f3e7
commit 878afcc8a7
No known key found for this signature in database
GPG key ID: 911B85FBC6003FE5

75
deploy.sh Normal file → Executable file
View file

@ -1,18 +1,19 @@
#!/bin/bash #!/bin/zsh
# to run this, execute # This is a script that should be ran once
# bash <(curl -sL git.reekynet.com/ReekyMarko/dotfiles/raw/branch/master/deploy.sh) # on a new system. Dotdrop will take it from there.
# It is higly tailored to my own needs and
# you (the random person on the internet) should probably not run it
# Run this to install my dotfiles on a fresh Arch Linux installation. export DOTREPO="$HOME/git/dotfiles"
# This should work on any Arch Linux install with an internet connection DISTRO="$(lsb_release -ds | sed 's/"//g')"
# and sudo rights
# When asked a hostname, make sure it's already in the dotrop config, PKGLIST=""
# otherwise dotdrop won't install anything
export DOTREPO="$HOME/Git/dotfiles" if [ -d $DOTREPO ]; then
export HOSTNAME="$(hostnamectl | head -n 1 | sed 's/ //g' | cut -d':' -f2-)" print "Dotfile repository already exists, exiting..."
export DISTRO="$(lsb_release -ds | sed 's/"//g')" exit 1
fi
if [ "$DISTRO" -ne "Arch Linux" ]; then if [ "$DISTRO" -ne "Arch Linux" ]; then
print "Not running on Arch Linux" print "Not running on Arch Linux"
@ -20,31 +21,51 @@ if [ "$DISTRO" -ne "Arch Linux" ]; then
exit 1 exit 1
fi fi
read -p "Hostname [$HOSTNAME]: " -i $HOSTNAME NEWHOSTNAME # install neovim if not installed
if [ "$HOSTNAME -ne $NEWHOSTNAME" ]; then if ! [ -x "$(command -v nvim)" ]; then
sudo hostnamectl set-hostname $NEWHOSTNAME read -p "Install neovim? [Y/n] " -i "y" INVIM
if [ "$(tr '[:upper:]' ':lower:' $INVIM)" -eq "y" ]; then
print "Installing neovim"
PKGLIST=$PKGLIST + " neovim neovim-dropin"
fi
fi fi
HOSTNAME=$NEWHOSTNAME
# install yay # install zsh if not installed
if ! [ -x "$(command -v yay)" ]; then if ! [ -x "$(command -v zsh)" ]; then
read -p "Install yay? [Y/n] " -i "y" IYAY read -p "Install zsh? [Y/n] " -i "y" IZSH
if [ "$(tr '[:upper:]' ':lower:' $IYAY)" -eq "y" ]; then if [ "$(tr '[:upper:]' ':lower:' $INVIM)" -eq "y" ]; then
print "Installing yay" print "Installing zsh"
PKGLIST=$PKGLIST + " zsh"
fi fi
fi
# install paru if not installed
if ! [ -x "$(command -v paru)" ]; then
read -p "Install paru? [Y/n] " -i "y" IYAY
if [ "$(tr '[:upper:]' ':lower:' $IYAY)" -eq "y" ]; then
print "Installing paru"
sudo pacman -Syu --needed --noconfirm git wget base-devel sudo pacman -Syu --needed --noconfirm git wget base-devel
cd cd
wget https://aur.archlinux.org/cgit/aur.git/snapshot/yay.tar.gz wget https://aur.archlinux.org/cgit/aur.git/snapshot/paru-bin.tar.gz
tar xfv yay.tar.gz tar xfv paru.tar.gz
cd yay cd paru
makepkg -si --noconfirm makepkg -si --noconfirm
cd .. cd ..
rm -r yay* rm -r paru*
fi
fi fi
mkdir ~/Git if [ $PKGLIST -ne "" ]
git clone https://git.reekynet.com/ReekyMarko/dotfiles.git $DOTREPO if ! [ -x "$(command -v paru)" ]; then
cd ~/Git/dotfiles print "Can't continue without paru"
paru -S $PKGLIST
fi
fi
mkdir ~/git
git clone https://git.korhonen.cc/ReekyMarko/dotfiles.git $DOTREPO
cd ~/git/dotfiles
git submodule init git submodule init
git submodule update git submodule update
$DOTREPO/dotdrop.sh --cfg=$DOTREPO/config-home.yaml install $DOTREPO/dotdrop.sh --cfg=$DOTREPO/config-home.yaml install