2021-03-14 19:41:58 +01:00
|
|
|
diff --git a/ytfzf b/ytfzf
|
2021-06-26 11:18:02 +02:00
|
|
|
index f4d2e0d..7a3b4b6 100755
|
2021-03-14 19:41:58 +01:00
|
|
|
--- a/ytfzf
|
|
|
|
+++ b/ytfzf
|
2021-06-26 11:18:02 +02:00
|
|
|
@@ -1260,22 +1260,8 @@ EOF
|
2021-03-14 19:41:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
update_ytfzf () {
|
2021-04-03 13:59:27 +02:00
|
|
|
- branch="$1"
|
|
|
|
- updatefile="/tmp/ytfzf-update"
|
2021-03-14 19:41:58 +01:00
|
|
|
- curl -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/ytfzf" -o "$updatefile"
|
|
|
|
-
|
2021-05-24 12:21:28 +02:00
|
|
|
- if sed -n '1p' < "$updatefile" | grep -q '#!/bin/sh'; then
|
2021-03-14 19:41:58 +01:00
|
|
|
- chmod 755 "$updatefile"
|
2021-06-26 11:18:02 +02:00
|
|
|
- [ "$(uname)" = "Darwin" ] && prefix="/usr/local/bin" || prefix="/usr/bin"
|
|
|
|
- function_exists "sudo" && doasroot="sudo" || doasroot="doas"
|
|
|
|
- $doasroot cp "$updatefile" "$prefix/ytfzf"
|
|
|
|
- unset prefix doasroot
|
2021-03-14 19:41:58 +01:00
|
|
|
- else
|
|
|
|
- printf "%bFailed to update ytfzf. Try again later.%b" "$c_red" "$c_reset"
|
|
|
|
- fi
|
|
|
|
-
|
|
|
|
- rm "$updatefile"
|
2021-06-26 11:18:02 +02:00
|
|
|
- exit 0
|
2021-03-14 19:41:58 +01:00
|
|
|
+ printf "%bUpdates have to be installed through Nix.%b\n" "$c_red" "$c_reset"
|
|
|
|
+ exit 1
|
|
|
|
}
|
|
|
|
|
2021-06-26 11:18:02 +02:00
|
|
|
#gives a value to sort by (this will give the unix time the video was uploaded)
|