mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 04:46:43 +00:00
40e2f9fb03
Prevent ytfzf from installing its own updates. Add all programs that are possibly used in the script to $PATH. A 10M increase in closure size seems very acceptable.
31 lines
733 B
Diff
31 lines
733 B
Diff
diff --git a/ytfzf b/ytfzf
|
|
index 5238682..c5c3a1a 100755
|
|
--- a/ytfzf
|
|
+++ b/ytfzf
|
|
@@ -757,23 +757,8 @@ clear_history () {
|
|
}
|
|
|
|
update_ytfzf () {
|
|
- branch="$1"
|
|
- updatefile="/tmp/ytfzf-update"
|
|
- curl -L "https://raw.githubusercontent.com/pystardust/ytfzf/$branch/ytfzf" -o "$updatefile"
|
|
-
|
|
- if sed -n '1p' < "$updatefile" | grep -q '#!/bin/sh' ; then
|
|
- chmod 755 "$updatefile"
|
|
- if [ "$(uname)" = "Darwin" ]; then
|
|
- sudo cp "$updatefile" "/usr/local/bin/ytfzf"
|
|
- else
|
|
- sudo cp "$updatefile" "/usr/bin/ytfzf"
|
|
- fi
|
|
- else
|
|
- printf "%bFailed to update ytfzf. Try again later.%b" "$c_red" "$c_reset"
|
|
- fi
|
|
-
|
|
- rm "$updatefile"
|
|
- exit
|
|
+ printf "%bUpdates have to be installed through Nix.%b\n" "$c_red" "$c_reset"
|
|
+ exit 1
|
|
}
|
|
|
|
|