From 1dbece8b2ef96eb03ccbc7f6b5e794d66a647d38 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 24 Feb 2020 02:57:12 -0800 Subject: 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. --- bb.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'bb.h') diff --git a/bb.h b/bb.h index 21bbe89..479943f 100644 --- a/bb.h +++ b/bb.h @@ -244,11 +244,14 @@ static const char *description_str = "bb - an itty bitty console TUI file browse static const char *usage_str = "Usage: bb (-h/--help | -v/--version | -s | -d | -0 | +command)* [[--] directory]\n"; static const char *runstartup = -"for path in \"$XDG_CONFIG_HOME/bb\" \"$sysconfdir/xdg/bb\" .; do\n" -" if [ -e \"$path/bbstartup.sh\" ]; then\n" -" . \"$path/bbstartup.sh\";\n" -" break;\n" -" fi;\n" -"done\n"; +"if [ \"$BBPATH\" ]; then\n" +" . \"$BBPATH/bbstartup.sh\"\n" +"else\n" +" for path in \"$XDG_CONFIG_HOME/bb\" \"$sysconfdir/xdg/bb\"; do\n" +" [ -e \"$path/bbstartup.sh\" ] || continue\n" +" . \"$path/bbstartup.sh\"\n" +" break\n" +" done\n" +"fi\n"; // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1 -- cgit v1.2.3