From 41104b4e14f205cc70dd7b23374aac2a73eeb0d1 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Mon, 11 Jan 2021 15:54:40 +0800 Subject: [PATCH] [feature] move basic dependencies installation after mirros.sh --- cli/basic.sh | 39 +++++++++++++++++++++++++++++++++++++++ cli/install.sh | 1 + env.sh | 33 --------------------------------- 3 files changed, 40 insertions(+), 33 deletions(-) create mode 100755 cli/basic.sh diff --git a/cli/basic.sh b/cli/basic.sh new file mode 100755 index 0000000..531364a --- /dev/null +++ b/cli/basic.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +set -e + +DIR=$(dirname "$(readlink -f "$0")") +. "$DIR/../env.sh" + +log "Installing basic utilities" +case "$PM" in + apt) + sudo apt install \ + build-essential \ + unzip p7zip \ + openssh-client \ + curl wget \ + man sudo + if [ -f /etc/lsb-release ]; then + set -a + . /etc/lsb-release + set +a + export DISTRIB_RELEASE_MAJOR=${DISTRIB_RELEASE%.*} + export DISTRIB_RELEASE_MINOR=${DISTRIB_RELEASE#.*} + fi + ;; + pacman) + sudo pacman -S --noconfirm --needed \ + base-devel \ + unzip p7zip \ + openssh \ + curl wget \ + man sudo + # install yay + if ! command -v yay >/dev/null; then + intorepo https://aur.archlinux.org/yay.git /tmp/yay + makepkg -si + exitrepo + fi + ;; +esac diff --git a/cli/install.sh b/cli/install.sh index f8b33d0..edbb0b4 100755 --- a/cli/install.sh +++ b/cli/install.sh @@ -6,6 +6,7 @@ DIR=$(dirname "$(readlink -f "$0")") timedatectl set-ntp on . "$DIR/mirrors.sh" +. "$DIR/basic.sh" . "$DIR/fish.sh" . "$DIR/vim.sh" . "$DIR/ranger.sh" diff --git a/env.sh b/env.sh index 3a1f32e..350f5f4 100755 --- a/env.sh +++ b/env.sh @@ -91,39 +91,6 @@ if [ "$PM" = "n/a" ]; then exit 1 fi -log "Installing basic utilities" -case "$PM" in - apt) - sudo apt install \ - build-essential \ - unzip p7zip \ - openssh-client \ - curl wget \ - man sudo - if [ -f /etc/lsb-release ]; then - set -a - . /etc/lsb-release - set +a - export DISTRIB_RELEASE_MAJOR=${DISTRIB_RELEASE%.*} - export DISTRIB_RELEASE_MINOR=${DISTRIB_RELEASE#.*} - fi - ;; - pacman) - sudo pacman -S --noconfirm --needed \ - base-devel \ - unzip p7zip \ - openssh \ - curl wget \ - man sudo - # install yay - if ! command -v yay >/dev/null; then - intorepo https://aur.archlinux.org/yay.git /tmp/yay - makepkg -si - exitrepo - fi - ;; -esac - log "Environments" echo " PM : $PM"