From 1d574b0d635d344bf02d447b66ad110fdd76e64c Mon Sep 17 00:00:00 2001 From: Andrejus Date: Thu, 7 Mar 2024 01:43:25 +0000 Subject: [PATCH] feat: brew and apt packages --- script/install.d/04-git.sh | 14 ++++++++++++++ script/install.d/21-gh_cli.sh | 19 +++++++++++++++++++ script/install.d/30-iterm2.sh | 12 ++++++++++++ .../{04-nerdfont.sh => 40-nerdfont.sh} | 0 script/install.d/70-cca.sh | 12 ++++++++++++ 5 files changed, 57 insertions(+) create mode 100644 script/install.d/04-git.sh create mode 100644 script/install.d/21-gh_cli.sh create mode 100644 script/install.d/30-iterm2.sh rename script/install.d/{04-nerdfont.sh => 40-nerdfont.sh} (100%) create mode 100644 script/install.d/70-cca.sh diff --git a/script/install.d/04-git.sh b/script/install.d/04-git.sh new file mode 100644 index 0000000..d56f452 --- /dev/null +++ b/script/install.d/04-git.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# ----------------------------------------------------------------------------- +# Description: +# Configure git. +# + +if ! command -v git &> /dev/null; then + if [[ "$OSTYPE" == "linux-gnu"* ]]; then + sudo apt-get install -qq git + elif [[ "$OSTYPE" == "darwin"* ]]; then + brew install git + fi +fi diff --git a/script/install.d/21-gh_cli.sh b/script/install.d/21-gh_cli.sh new file mode 100644 index 0000000..642e86f --- /dev/null +++ b/script/install.d/21-gh_cli.sh @@ -0,0 +1,19 @@ +# /bin/bash + +# ----------------------------------------------------------------------------- +# Description: +# Install GitHub CLI. +# + +if ! command -v gh &>/dev/null; then + if [[ "$OSTYPE" == "linux-gnu"* ]]; then + # https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt + sudo mkdir -p -m 755 /etc/apt/keyrings && wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg >/dev/null && + sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg && + echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null && + sudo apt update && + sudo apt install gh -y + elif [[ "$OSTYPE" == "darwin"* ]]; then + brew install gh + fi +fi diff --git a/script/install.d/30-iterm2.sh b/script/install.d/30-iterm2.sh new file mode 100644 index 0000000..93efee3 --- /dev/null +++ b/script/install.d/30-iterm2.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# ----------------------------------------------------------------------------- +# Description: +# (macOS only) Install iTerm2. +# + +if [[ "$OSTYPE" == "darwin"* ]]; then + if ! command -v iterm2 &> /dev/null; then + brew install --cask iterm2 + fi +fi diff --git a/script/install.d/04-nerdfont.sh b/script/install.d/40-nerdfont.sh similarity index 100% rename from script/install.d/04-nerdfont.sh rename to script/install.d/40-nerdfont.sh diff --git a/script/install.d/70-cca.sh b/script/install.d/70-cca.sh new file mode 100644 index 0000000..a6cf1d2 --- /dev/null +++ b/script/install.d/70-cca.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# ----------------------------------------------------------------------------- +# Description: +# (macOS only) Install Colour Contrast Analyser (CCA). +# + +if [[ "$OSTYPE" == "darwin"* ]]; then + if ! command -v cca &> /dev/null; then + brew install --cask colour-contrast-analyser + fi +fi