Add default for bindir.

This commit is contained in:
Calvin Rose 2019-05-28 22:12:42 -04:00
parent c6ac53f4be
commit 6c897b1a37
3 changed files with 12 additions and 5 deletions

View File

@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
## 0.6.0 - ??
- Update windows installer to include tools like `jpm`.
- Add `jpm` tool for building and managing projects.
- Change interface to `cook` tool.
- Add optional filters to `module/paths` to further refine import methods.

View File

@ -97,7 +97,10 @@
(def [realpath] (module/find path))
(def env (make-env))
(loop [k :keys _env :when (symbol? k)]
(unless ((_env k) :private) (put env k (_env k))))
(unless ((_env k) :private) (put env k (_env k))))
(def currenv (fiber/getenv (fiber/current)))
(loop [k :keys currenv :when (keyword? k)]
(put env k (currenv k)))
(require path :env env ;args)
(when-let [rules (env :rules)] (merge-into (getrules) rules)))
@ -112,8 +115,8 @@
#
# Installation settings
(def BINDIR (os/getenv "JANET_BINDIR"))
(def LIBDIR (or (os/getenv "JANET_PATH") module/*syspath*))
(def BINDIR (or (os/getenv "JANET_BINDIR") (unless is-win "/usr/local/bin")))
(def INCLUDEDIR (or (os/getenv "JANET_HEADERPATH") module/*headerpath*))
# Compilation settings

View File

@ -4,8 +4,6 @@
(import cook :prefix "")
(import-rules "./project.janet")
(def- argpeg
(peg/compile
'(* "--" '(some (if-not "=" 1)) "=" '(any 1))))
@ -30,10 +28,15 @@ Keys are:
`))
(def args (tuple/slice process/args 2))
(def todo @[])
(each arg args
(if (string/has-prefix? "--" arg)
(let [[key value] (peg/match argpeg arg)]
(setdyn (keyword key) value))
(do-rule arg)))
(array/push todo arg)))
(import-rules "./project.janet")
(each r todo (do-rule r))
(if (empty? args) (help))