-
Notifications
You must be signed in to change notification settings - Fork 37
/
install
executable file
·23 lines (21 loc) · 759 Bytes
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
if (( `uname` == "Darwin" )); then
BIN=/usr/local/bin
BASH_COMPLETION_D=/usr/local/etc/bash_completion.d
CURL=curl
else
# check if user is root
# and re-exec the script with sudo if not
#
# equivalent to: [ "$(whoami)" != "root" ] && exec sudo -- "$0" "$@"
# bash only, but without external call to whoami
#
(( EUID != 0 )) && exec sudo -- "$0" "$@"
BIN=/usr/bin
BASH_COMPLETION_D=/etc/bash_completion.d
CURL="sudo curl"
fi
echo "Installing with"
$CURL -s https://raw.githubusercontent.com/mchav/with/master/with -o $BIN/with && chmod +x $BIN/with
$CURL -s https://raw.githubusercontent.com/mchav/with/master/with.bash-completion -o $BASH_COMPLETION_D/with.bash-completion
echo "with successfully installed!"