This repository was archived by the owner on May 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapps.sh
More file actions
executable file
·57 lines (51 loc) · 1.61 KB
/
apps.sh
File metadata and controls
executable file
·57 lines (51 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
if [[ $# -eq 0 ]]; then
echo "Usage: ./apps.sh brews npm apps atom"
else
test -f $HOME/.setup && . $_
test -f bin/common.sh && . $_
fi
caskinfo () {
#brew info $1 --json=v2 | python -c "import json,sys;obj=json.load(sys.stdin);print obj['casks'][0][\"$2\"][0];"
brew info $1 --json=v2 | perl -nle "print \$1 if /(?<=\"$2\":\[\")([^\"]*)/"
}
for cmd in "$@"; do
case "$cmd" in
"brews")
alert "Tapping Brews..."
cat data/taps.txt | while read tap; do
brew tap $tap
done
alert "Installing Brews..."
cat data/brews.txt | while read brew; do
brew install $brew
done
;;
"npm")
alert "Installing NVM..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
. ~/.bash_profile # loads NVM
command -v nvm >/dev/null 2>&1 && alert -t success "NVM Installed" || alert -t error "NVM Install Failed"
alert "Installing Node..."
nvm install --lts
# Note: Slate and Yarn will both install Node
alert "Installing NPM Plugins (requires brews)..."
cat data/npm.txt | while read package; do
npm install -g $package
done
;;
"apps")
alert "Installing Apps (Not Yet Supported)..."
cat data/casks.txt | while read cask; do
printf "Installing $(caskinfo $cask name)\n"
printf "brew cask install $cask\n\n"
done
;;
"atom")
alert "Installing Atom Packages..."
cat data/atom.txt | while read package; do
apm install $package
done
;;
esac
done