aboutsummaryrefslogtreecommitdiff
#! /usr/bin/env guile
!#

(import (ice-9 match))

(define (prepend-path-environment! name . values)
  (setenv name (string-join (append values
                                    (if (getenv name)
                                        (string-split (getenv name) #\:)
                                        '()))
                            ":")))

(define %source-dir
  (dirname (current-filename)))

(prepend-path-environment! "GUILE_LOAD_PATH" %source-dir)
(prepend-path-environment! "GUILE_LOAD_COMPILED_PATH" %source-dir)

(match (command-line)
  ((_ command args ...)
   (apply execlp command command args)))