~subsetpark/bagatto

f2f7bf4629d55635008e94bd38e64d86a3822d17 — Zach Smith 4 months ago bd6b7e0
Allow external libraries in index directory
2 files changed, 7 insertions(+), 8 deletions(-)

M main.janet
M src/env.janet
M main.janet => main.janet +2 -2
@@ 24,13 24,13 @@

(defn main [& args]
  (merge-into root-env core/bagatto)
  (env/prepare-root-env!)

  (when-let [args (argparse ;argparse-params)]
    (let [index (args :default)
          env (prepare-env index)]

      (env/prepare-environment! env)
      (env/populate-exec-blacklist!)
      (merge-into temple/base-env env)

      (if (args "repl")
        # REPL mode: Enter a REPL to experiment with the contents of the

M src/env.janet => src/env.janet +5 -6
@@ 30,7 30,7 @@
    nil :ok
    janet-path (put root-env :syspath janet-path)))

(defn populate-exec-blacklist!
(defn- populate-exec-blacklist!
  ```
  Iterate through all the executables declared with `defrequire` and
  check for their existence in the path. Add a blacklist of all


@@ 41,9 41,8 @@
      (unless (on-path? check)
        (put exec-blacklist check true))))

(defn prepare-environment!
  [env]
(defn prepare-root-env!
  []
  (prepare-syspath!)
  (temple/add-loader)
  # Monkey-patch the temple environment with the functions defined
  # in the index module.
  (merge-into temple/base-env env))
  (populate-exec-blacklist!))