aboutsummaryrefslogtreecommitdiff
path: root/files/.zsh
diff options
context:
space:
mode:
authorAnton Bobov <anton@bobov.name>2024-02-08 19:38:12 +0500
committerAnton Bobov <anton@bobov.name>2024-02-08 19:38:12 +0500
commit7652c45609757b7aa5541dc0ae156333366d5cd4 (patch)
tree09b0bd6253d73f9125df5f528525cf4a5fda1d92 /files/.zsh
parent727e75a26120c8b56e93c7319281cbfc84d63a8b (diff)
[eget] Add local eget config
Diffstat (limited to 'files/.zsh')
-rw-r--r--files/.zsh/rc/S20_eget15
1 files changed, 15 insertions, 0 deletions
diff --git a/files/.zsh/rc/S20_eget b/files/.zsh/rc/S20_eget
index 0a0aa26..cdd9713 100644
--- a/files/.zsh/rc/S20_eget
+++ b/files/.zsh/rc/S20_eget
@@ -1,5 +1,20 @@
function () {
__EGET_LOCATION="$HOME/.local/bin/eget"
+ __EGET_CONFIG="$HOME/.eget.toml"
+ __EGET_CONFIG_LOCAL="$HOME/.eget.local.toml"
+
+ if [ -x "$__EGET_LOCATION" ] ; then
+ function eget() {
+ config="$__EGET_CONFIG"
+ if [ -f "$__EGET_CONFIG_LOCAL" ] ; then
+ config=$(mktemp -t eget.config.XXXXX --suffix .toml)
+ trap "rm '$config'" EXIT
+ cat "$__EGET_CONFIG" "$__EGET_CONFIG_LOCAL" >"$config" 2>/dev/null
+ fi
+
+ (export EGET_CONFIG="$config" && "$__EGET_LOCATION" "$@")
+ }
+ fi
if [ ! -x "$__EGET_LOCATION" ] ; then
function eget() {