summary refs log tree commit diff
path: root/guile-pre-inst-env
diff options
context:
space:
mode:
authorArun Isaac2025-11-17 18:13:38 +0000
committerArun Isaac2025-11-17 18:13:38 +0000
commit7de88aa02274dd9c55b38797ddd66456941597b3 (patch)
treee4ac4752e69cd705ffc5086c53b30cb4d62acf48 /guile-pre-inst-env
parent8381be378a361a4a67bee24cf0f35acca7968bb1 (diff)
downloadrun64-7de88aa02274dd9c55b38797ddd66456941597b3.tar.gz
run64-7de88aa02274dd9c55b38797ddd66456941597b3.tar.lz
run64-7de88aa02274dd9c55b38797ddd66456941597b3.zip
Add guile-pre-inst-env convenience script.
Diffstat (limited to 'guile-pre-inst-env')
-rwxr-xr-xguile-pre-inst-env36
1 files changed, 36 insertions, 0 deletions
diff --git a/guile-pre-inst-env b/guile-pre-inst-env
new file mode 100755
index 0000000..a723e5f
--- /dev/null
+++ b/guile-pre-inst-env
@@ -0,0 +1,36 @@
+#! /usr/bin/env guile
+!#
+;;; run64 --- SRFI-64 test runner
+;;; Copyright © 2022, 2025 Arun Isaac <arunisaac@systemreboot.net>
+;;;
+;;; This file is part of run64.
+;;;
+;;; run64 is free software: you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation, either version 3 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; run64 is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with run64.  If not, see <https://www.gnu.org/licenses/>.
+
+(use-modules (chibi match))
+
+(define (prepend-path-env! name . values)
+  (setenv name (string-join (append values
+                                    (if (getenv name)
+                                        (string-split (getenv name) #\:)
+                                        '()))
+                            ":")))
+
+(define %source-dir (dirname (current-filename)))
+
+(prepend-path-env! "PATH" (string-append %source-dir "/bin"))
+
+(match (command-line)
+  ((_ command args ...)
+   (apply execlp command command args)))