Rewrite install script

This commit is contained in:
Andrejus
2020-07-11 20:59:48 +01:00
parent 0eb21776db
commit 21757767d2
24 changed files with 88 additions and 75 deletions

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
clean
update

View File

@@ -1,13 +1,11 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
bash_source="$dotfiles_dir/bash"
bash_target="$HOME"
link_folder "$bash_source" "$bash_target"
echo "bash dotfiles are linked"
source "$HOME/.bashrc"
echo "bashrc sourced"
sudo chmod -R 0644 /etc/update-motd.d/
bash --version

View File

@@ -1,11 +1,11 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
if not_installed "fish"; then
echo "installing fish..."
add_ppa "fish-shell/release-3"
update
install fish
fi
echo "fish is installed"

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
# ssh key exists
ssh_target="$HOME/.ssh"

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
# git dotfiles are symlinked
git_source="$dotfiles_dir/git"

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
# pyenv is installed
if not_installed "pyenv"; then

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
# python3 and pip3 are installed
if not_installed "pip3"; then

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
# poetry is installed
if not_installed "poetry"; then

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
# nvm is installed
if not_installed "nvm"; then

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
# yarn is installed
if not_installed "yarn"; then

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
if not_installed "java"; then
echo "Installing java..."

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
vim_source="$dotfiles_dir/vim"
vim_target="$XDG_CONFIG_HOME/nvim"

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
if not_installed "elm"; then
curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
# docker is installed
DOCKER_FOLDER="$HOME/.docker"

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
if not_installed "firebase"; then
echo "Installing firebase..."

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip -d "$dotfiles_dir/tmp"

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
if not_installed "terraform"; then
echo "Installing terraform..."

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
echo "cleaning"
clean

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(dirname $0)/utils.sh"
if not_installed "screenfetch"; then
echo "Installing screenfetch..."

View File

@@ -1,4 +1,10 @@
#!/usr/bin/env bash
# ---------------------------------------------------------------------------- #
# Helper variables #
# ---------------------------------------------------------------------------- #
install_dir="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )";
dotfiles_dir="$(dirname "$install_dir")";
# ---------------------------------------------------------------------------- #
# Helper functions
# ---------------------------------------------------------------------------- #
@@ -8,28 +14,28 @@ clean() {
}
update() {
sudo apt-get update -qq
sudo apt-get update
}
# Non-interactive upgrade
# Skip if FAST_MODE is defined
upgrade() {
[ "$FAST_MODE" != false ] && return
DEBIAN_FRONTEND=noninteractive \
sudo apt-get dist-upgrade -qq \
sudo apt-get \
-o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold"
-o Dpkg::Options::="--force-confold" \
-y \
dist-upgrade
}
# @arg $1 packages to install
install() {
sudo apt-get install -qq $1
sudo apt-get install $1
refresh
}
# @arg $1 package list file to install
install_file() {
sudo apt-get install -fqq $(cat $1)
sudo apt-get install -f $(cat $1)
refresh
}