dotfiles/install.sh
Severin Kaderli 0bf9c3067c Use array for keeping track of files
Signed-off-by: Severin Kaderli <severin.kaderli@gmail.com>
2018-12-09 10:14:32 +01:00

53 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
#
# Author: Severin Kaderli <severin.kaderli@gmail.com>
# Usage: ./install.sh
FILES=(
".gitconfig"
".vimrc"
".bash_logout"
".bash_profile"
".bashrc"
".aliases"
".xinitrc"
".Xresources"
".config/i3"
".config/termite"
".config/polybar"
".config/dunst"
".config/compton.conf"
".dircolors"
".hyper.js"
"bin"
".crontab"
)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# TODO: Install yaourt or else the next thing fails
# Install packages - "yaourt -Qqe > packages.list"
yaourt -S $(cat "$DIR/yaourt/packages.list")
# Install aur packages - "yaourt -Qqm > packages.aur.list"
yaourt -S --noconfirm $(cat "$DIR/yaourt/packages.aur.list")
# TODO: Create a function that makes the linking easier and that checks if
# the links already exists
for file in "${FILES[@]}"
do
rm -rf "$HOME/$file"
ln -fs "$DIR/$file" "$HOME/$file"
done
# ive scripts execute permissions
chmod +x "$HOME/bin/*"
# Download and install composer
# TODO: Install this using yaourt
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv "$DIR/composer.phar" "$HOME/bin/composer"