mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-07-30 08:08:15 -05:00
* src/bin/gnucash-env.in: new file -- you can use this to invoke
programs or scripts with the proper gnucash environment. i.e. "gnucash-env guile -s foo bar" or "gnucash-env some-command arg1 arg2 ..." git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5945 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
exec @-GUILE-@ -s "$0" "$@"
|
||||
!#
|
||||
|
||||
;; Usage: gnucash-env any-cmd [ args ... ]
|
||||
;; runs any-cmd in an environment appropriate for gnucash.
|
||||
;; we'll also add a gnucash-build-env later for running from the install tree.
|
||||
|
||||
;; Don't put any envt settings, etc above in /bin/sh section --
|
||||
;; otherwise, we can't invoke this directly from within an interactive
|
||||
;; guile and have it work (for debugging).
|
||||
|
||||
(setenv "LD_LIBRARY_PATH"
|
||||
(apply string-append
|
||||
(or (getenv "LD_LIBRARY_PATH") "")
|
||||
(list ":"
|
||||
"@-GNC_LIBDIR-@"
|
||||
":"
|
||||
"@-GNC_MODULE_DIR-@")))
|
||||
|
||||
(setenv "GNC_MODULE_PATH"
|
||||
(apply string-append
|
||||
(or (getenv "GNC_MODULE_PATH") "")
|
||||
(list ":" "@-GNC_PKGLIB_INSTALLDIR-@")))
|
||||
|
||||
(setenv "GUILE_LOAD_PATH"
|
||||
(apply string-append
|
||||
(or (getenv "GUILE_LOAD_PATH") "")
|
||||
(list
|
||||
":"
|
||||
"@-G_WRAP_MODULE_DIR-@"
|
||||
":"
|
||||
"@-GNC_GUILE_MODULE_DIR-@"
|
||||
":"
|
||||
"@-GNC_SCM_INSTALL_DIR-@")))
|
||||
|
||||
(if (null? (program-arguments))
|
||||
(exit 0)
|
||||
(apply execlp (cadr (program-arguments)) (cdr (program-arguments))))
|
||||
|
||||
;; Local Variables:
|
||||
;; mode: scheme
|
||||
;; End:
|
||||
Reference in New Issue
Block a user