Skip to content

Commit

Permalink
Guard against MacOS in github-sourced package installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
fortes committed Sep 12, 2024
1 parent 4df6003 commit 4787b06
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions scripts/install_github_packages
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ set -euo pipefail
IFS=$'\n\t'
export DEBIAN_FRONTEND=noninteractive

declare dotfiles_root
dotfiles_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"

AVAILABLE_PACKAGES=(
agg
browsh
Expand Down Expand Up @@ -299,6 +302,15 @@ install_zellij() {
}

install_github_packages() {
# Make sure to load `command_exists` helper
# shellcheck source=../stowed-files/bash/.profile
. "${dotfiles_root}/stowed-files/bash/.profile"

if ! command_exists apt-get; then
echo_stderr "Only works on Debian-like systems"
exit 1
fi

local packages=("$@")
if [ "${#packages[@]}" -eq 0 ]; then
packages=("${AVAILABLE_PACKAGES[@]}")
Expand Down

0 comments on commit 4787b06

Please sign in to comment.