-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathup
executable file
·31 lines (31 loc) · 1.52 KB
/
up
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
#!/bin/sh
set -eu
DOTPATH="${DOTPATH:-$HOME/dotfiles}"
URL="${URL:-https://github.com/4513ECHO/dotfiles}"
error() {
printf '\e[1;38;5;1mError\e[m: %s\n' "$*" 1>&2
exit 1
}
[ -d "$DOTPATH" ] && error "$DOTPATH has already existed."
printf '\e[1m'
cat << 'EOF'
.------------------------------------------------------------------------------.
: :
: d88 d88 .d888 d8b d88 :
: 888 888 d88P" Y8P 888 :
: 888 888 888 888 :
: .d88888 .d88b. d888888 d888888 888 888 .d88b. .d8888b :
: d88" 888 d88""88b 888 888 888 888 d8P Y8b 88K :
: 888 888 888 888 888 888 888 888 88888888 "Y8888b. :
: Y88b 888 Y88..88P Y88b. 888 888 888 Y8b. X88 :
: "Y8888P "Y88P" "Y888 88P 88P 88P "Y888P 88888P" :
: :
: https://github.com/4513ECHO/dotfiles :
: :
'------------------------------------------------------------------------------'
EOF
printf '\e[m'
git clone --filter=blob:none "$URL" "$DOTPATH"
cd "$DOTPATH" || error "Could not change directory to $DOTPATH"
make install
exec "$SHELL" -l