-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmac.sh
More file actions
executable file
·38 lines (34 loc) · 752 Bytes
/
mac.sh
File metadata and controls
executable file
·38 lines (34 loc) · 752 Bytes
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
#!/usr/bin/env bash
# Mac OS X自动化配置
function backup_package() {
brew list > brew.list
brew cask list > cask.list
mas list > mas.list
}
function install_package() {
if [ -f "tap.list" ]; then
cat tap.list | xargs brew tap
fi
if [ -f "brew.list" ]; then
cat brew.list | xargs brew install
fi
if [ -f "cask.list" ]; then
cat cask.list | xargs brew cask instatll
fi
if [ -f "mas.list" ]; then
cat mas.list | awk '{print $1}' | xargs mas instatll
fi
}
while getopts "ib" arg; do
case $arg in
'i')
install_package
;;
'b')
backup_package
;;
*)
echo "Usege: -i -b"
;;
esac
done