diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-02-24 02:57:12 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-02-24 02:57:12 -0800 |
| commit | 1dbece8b2ef96eb03ccbc7f6b5e794d66a647d38 (patch) | |
| tree | fdcc7599c23799bc6a8c7b1610ff94969743802d /bbstartup.sh | |
| parent | 9a7938ba2d0814b14003e7dcae904d98ca79ad8e (diff) | |
Added a slightly hacky fix to make sure `bb` can be run from the local
build directory and still have the helper scripts, bbstartup.sh, and the
bindings work.
Diffstat (limited to 'bbstartup.sh')
| -rwxr-xr-x | bbstartup.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bbstartup.sh b/bbstartup.sh index 9058169..e316373 100755 --- a/bbstartup.sh +++ b/bbstartup.sh @@ -5,13 +5,13 @@ # Load key bindings # first check ~/.config/bb/bindings.bb, then /etc/xdg/bb/bindings.bb, then ./bindings.bb [ ! -d "$XDG_DATA_HOME/bb" ] && mkdir -p "$XDG_DATA_HOME/bb" -if [ ! -e "$XDG_CONFIG_HOME/bb/bindings.bb" ] && [ ! -e "$sysconfdir/xdg/bb/bindings.bb" ]; then - cat "./bindings.bb" 2>/dev/null | awk '/^#/ {next} /^[^ ]/ {printf "\0bind:"} {print $0} END {printf "\0"}' >> "$BBCMD" + +if [ "$BBPATH" ]; then + cat "$BBPATH/bindings.bb" 2>/dev/null else - for path in "$sysconfdir/xdg/bb" "$XDG_CONFIG_HOME/bb"; do - cat "$path/bindings.bb" 2>/dev/null - done | awk '/^#/ {next} /^[^ ]/ {printf "\0bind:"} {print $0} END {printf "\0"}' >> "$BBCMD" -fi + cat "$sysconfdir/xdg/bb/bindings.bb" "$XDG_CONFIG_HOME/bb/bindings.bb" 2>/dev/null +fi | awk '/^#/ {next} /^[^ ]/ {printf "\0bind:"} {print $0} END {printf "\0"}' >> "$BBCMD" + if [ -e "$XDG_DATA_HOME/bb/state.sh" ]; then . "$XDG_DATA_HOME/bb/state.sh" fi |
