aboutsummaryrefslogtreecommitdiff
path: root/files/.zsh/rc
diff options
context:
space:
mode:
Diffstat (limited to 'files/.zsh/rc')
-rw-r--r--files/.zsh/rc/S20_eget33
1 files changed, 33 insertions, 0 deletions
diff --git a/files/.zsh/rc/S20_eget b/files/.zsh/rc/S20_eget
new file mode 100644
index 0000000..09eef28
--- /dev/null
+++ b/files/.zsh/rc/S20_eget
@@ -0,0 +1,33 @@
+function () {
+ EGET_LOCATION="$HOME/.local/bin/eget"
+
+ if [ ! -x "$EGET_LOCATION" ] ; then
+ function eget() {
+ local EGET_SCRIPT_URL="https://zyedidia.github.io/eget.sh"
+ local EGET_SCRIPT_CHECKSUM="0e64b8a3c13f531da005096cc364ac77835bda54276fedef6c62f3dbdc1ee919"
+ vared -p 'No eget found, install it?: (y/N) ' -c answer
+ case "$answer" in
+ y|Y)
+ unset -f eget
+ temp_file=$(mktemp)
+ trap 'rm -f "$temp_file"' EXIT
+ curl -o "$temp_file" "$EGET_SCRIPT_URL"
+ echo "$EGET_SCRIPT_CHECKSUM $temp_file" | shasum --algorithm 256 --check --quiet
+ (cd $(dirname "$EGET_LOCATION") && sh "$temp_file")
+ ;;
+ *)
+ return
+ ;;
+ esac
+ answer=""
+ vared -p 'Download all by eget?: (y/N) ' -c answer
+ case "$answer" in
+ y|Y)
+ eget --download-all
+ ;;
+ esac
+ }
+ fi
+}
+
+# vim: ft=zsh