Compare commits

...

3 Commits

Author SHA1 Message Date
PorridgePi
a507be1a51 bootstrap: feat: Add priority via filename 2022-09-29 19:10:16 +08:00
PorridgePi
d02ca42759 bootstrap: homebrew: Initial commit 2022-09-29 19:06:11 +08:00
PorridgePi
04ed5c5368 bootstrap: feat: Add example.sh 2022-09-29 18:53:46 +08:00
3 changed files with 51 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
# macOS ONLY
source $HOME/.zshenv
if [[ "$OSNAME" == "macOS" ]]; then
# macOS
if ! command -v brew &> /dev/null; then
echo 'Installing Homebrew'
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
echo 'Homebrew is installed'
fi

View File

@@ -0,0 +1,38 @@
if ! command -v PROGRAM_NAME &> /dev/null; then
echo 'Installing PROGRAM_NAME'
source $HOME/.zshenv
if [[ "$OSNAME" == "Linux" ]]; then
# Linux
if [[ "$DISTRO_TYPE" == "debian" ]]; then
# Debian-based
elif [[ "$DISTRO_TYPE" == "rpm" ]]; then
# RPM-based
echo 'ERROR: Currently unsupported'
echo 'Exiting...'
exit 1
elif [[ "$DISTRO_TYPE" == "arch" ]]; then
# Arch-based
echo 'ERROR: Currently unsupported'
echo 'Exiting...'
exit 1
else
# Unknown distro
echo 'ERROR: Unknown distro'
echo 'Exiting...'
exit 1
fi
elif [[ "$OSNAME" == "macOS" ]]; then
# macOS
else
# Unknown
echo 'ERROR: Unknown OS'
echo 'Exiting...'
exit 1
fi
fi
echo 'PROGRAM_NAME is installed'