Add config dir to default load path
authorClinton Ebadi <clinton@unknownlamer.org>
Fri, 8 May 2020 04:02:26 +0000 (00:02 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Fri, 8 May 2020 04:02:26 +0000 (00:02 -0400)
Sometime between Guile 1.8 and 3.0, the cwd was removed from the
default search path, and we rely on that for Interp::LoadScript, but
only because cwd is the config directory. For now, just hack around it
by adding `(getcwd)' to the path, which will be the user config
directory.

scripts/bobot-utils.scm

index 8a09c62..72bfa55 100644 (file)
 (use-modules (srfi srfi-1)
             (srfi srfi-13))
 
-(eval-when (compile load eval)
-          (set! %load-path (cons* (string-append (getenv "HOME") "/.bobotpp/scripts/")
-                                  bot:sys-scripts-dir
-                                  %load-path)))
+(add-to-load-path bot:sys-scripts-dir)
+(add-to-load-path (string-append (getenv "HOME") "/.bobotpp/scripts/"))
+;; FIXME: effect is to add current config dir, should be explicit
+;; instead (and we don't want to change cwd to config dir necessarily)
+(add-to-load-path (getcwd))
 
 ;;; bot:log: Write as many messages as you want to the log.  If the
 ;;; arg is a thunk it will be executed and it's output will be
  (_deprecated-fun bot-addtimer bot:addtimer)
  (_deprecated-fun bot-deltimer bot:deltimer)
  
- (define-public hooks/leave hooks/part))
\ No newline at end of file
+ (define-public hooks/leave hooks/part))