-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·36 lines (28 loc) · 923 Bytes
/
install.sh
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
#!/bin/bash
usage="$(basename "$0") [-hS]
where:
-h show this help and exit
-S install for setapp version of Numi"
while getopts ':hS' option; do
case "$option" in
h) echo "$usage"
exit
;;
S) version="setapp"
;;
\?) printf "illegal option: -%s\n" "$OPTARG" >&2
echo "$usage" >&2
exit 1
;;
esac
done
bold=$(tput bold)
normal=$(tput sgr0)
# Make sure previous version is properly removed
printf "${bold}Removing previous version:${normal}\n"
rm -vr ~/Library/Application\ Support/LaunchBar/Actions/Numi\ Calculate.lbaction
printf "\n${bold}Installing new version:${normal}\n"
cp -vr Numi\ Calculate.lbaction ~/Library/Application\ Support/LaunchBar/Actions/
if [ "$version" == "setapp" ]; then
sed -i '' 's/com.dmitrynikolaev.numi</com.nikolaeu.numi-setapp</g' "$HOME/Library/Application Support/Launchbar/Actions/Numi Calculate.lbaction/Contents/Info.plist"
fi