-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathuninstall
More file actions
52 lines (43 loc) · 1.2 KB
/
uninstall
File metadata and controls
52 lines (43 loc) · 1.2 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
#!/bin/sh
set -e
die() {
printf "\033[1;31m%s\033[0m\n" "$*" >&2
exit 1
}
info() {
printf "\033[1;34m%s\033[0m\n" "$*"
}
ok() {
printf "\033[1;32m%s\033[0m\n" "$*"
}
bin_dir="/usr/local/bin"
# Detect environment and set lua path
if command -v wslpath >/dev/null 2>&1; then
win_home="$(wslpath "$(cmd.exe /c "<nul set /p=%UserProfile%" 2>/dev/null)")"
lua_dir="${win_home}/scoop/apps/mpv/current/portable_config/scripts"
elif [ "$OSTYPE" = "msys" ] || [ "$MSYSTEM" = "MINGW64" ] || [ "$MSYSTEM" = "MINGW32" ]; then
bin_dir="/usr/bin"
lua_dir="${HOME}/scoop/apps/mpv/current/portable_config/scripts"
else
lua_dir="${HOME}/.config/mpv/scripts"
fi
# Remove ani-skip
if [ -f "$bin_dir/ani-skip" ]; then
if [ -w "$bin_dir" ]; then
rm "$bin_dir/ani-skip"
else
info "Need sudo to remove from $bin_dir"
sudo rm "$bin_dir/ani-skip"
fi
ok "Removed $bin_dir/ani-skip"
else
info "ani-skip not found in $bin_dir"
fi
# Remove mpv integration
if [ -f "$lua_dir/skip.lua" ]; then
rm "$lua_dir/skip.lua"
ok "Removed mpv integration from $lua_dir"
else
info "mpv integration not found in $lua_dir"
fi
ok "Done! ani-skip has been uninstalled."