-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
126 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/bin/bash | ||
############################################################# | ||
# Install macOS via brew cask | ||
# Author: Vincent Zhang <[email protected]> | ||
# URL: https://github.com/seagle0128/dotfiles | ||
############################################################# | ||
|
||
# Cask applications | ||
packages=( | ||
# prerequisite | ||
git | ||
zsh | ||
unzip | ||
|
||
# modern tools | ||
bat | ||
bottom | ||
btop | ||
delta | ||
duf | ||
dust | ||
fd | ||
fzf | ||
gitui | ||
gping | ||
hyperfine | ||
neofetch | ||
procs | ||
ripgrep | ||
sd | ||
tealdeer | ||
zoxide | ||
) | ||
|
||
# Use colors, but only if connected to a terminal, and that terminal | ||
# supports them. | ||
if command -v tput >/dev/null 2>&1; then | ||
ncolors=$(tput colors) | ||
fi | ||
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then | ||
RED="$(tput setaf 1)" | ||
GREEN="$(tput setaf 2)" | ||
YELLOW="$(tput setaf 3)" | ||
BLUE="$(tput setaf 4)" | ||
BOLD="$(tput bold)" | ||
NORMAL="$(tput sgr0)" | ||
else | ||
RED="" | ||
GREEN="" | ||
YELLOW="" | ||
BLUE="" | ||
BOLD="" | ||
NORMAL="" | ||
fi | ||
|
||
function check { | ||
# Check OS | ||
if [[ $OSTYPE != darwin* ]]; then | ||
echo "${RED}Error: only install software via brew on macOS.${NORMAL}" >&2 | ||
exit 1 | ||
fi | ||
|
||
# Check brew | ||
if ! command -v brew >/dev/null 2>&1; then | ||
printf "${BLUE} ➜ Installing Homebrew...${NORMAL}\n" | ||
|
||
xcode-select --install | ||
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install@HEAD/install.sh)" | ||
fi | ||
} | ||
|
||
function install () { | ||
for app in ${packages[@]}; do | ||
printf "${BLUE} ➜ Installing ${app}...${NORMAL}\n" | ||
brew install ${app} | ||
done | ||
} | ||
|
||
function cleanup { | ||
brew cleanup | ||
} | ||
|
||
function main { | ||
check | ||
install | ||
cleanup | ||
} | ||
|
||
main |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters