mirror of
https://github.com/janet-lang/janet
synced 2024-12-26 08:20:27 +00:00
Add default for bindir.
This commit is contained in:
parent
c6ac53f4be
commit
6c897b1a37
@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
## 0.6.0 - ??
|
## 0.6.0 - ??
|
||||||
|
|
||||||
|
- Update windows installer to include tools like `jpm`.
|
||||||
- Add `jpm` tool for building and managing projects.
|
- Add `jpm` tool for building and managing projects.
|
||||||
- Change interface to `cook` tool.
|
- Change interface to `cook` tool.
|
||||||
- Add optional filters to `module/paths` to further refine import methods.
|
- Add optional filters to `module/paths` to further refine import methods.
|
||||||
|
@ -98,6 +98,9 @@
|
|||||||
(def env (make-env))
|
(def env (make-env))
|
||||||
(loop [k :keys _env :when (symbol? k)]
|
(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)
|
(require path :env env ;args)
|
||||||
(when-let [rules (env :rules)] (merge-into (getrules) rules)))
|
(when-let [rules (env :rules)] (merge-into (getrules) rules)))
|
||||||
|
|
||||||
@ -112,8 +115,8 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Installation settings
|
# Installation settings
|
||||||
(def BINDIR (os/getenv "JANET_BINDIR"))
|
|
||||||
(def LIBDIR (or (os/getenv "JANET_PATH") module/*syspath*))
|
(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*))
|
(def INCLUDEDIR (or (os/getenv "JANET_HEADERPATH") module/*headerpath*))
|
||||||
|
|
||||||
# Compilation settings
|
# Compilation settings
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
(import cook :prefix "")
|
(import cook :prefix "")
|
||||||
|
|
||||||
(import-rules "./project.janet")
|
|
||||||
|
|
||||||
(def- argpeg
|
(def- argpeg
|
||||||
(peg/compile
|
(peg/compile
|
||||||
'(* "--" '(some (if-not "=" 1)) "=" '(any 1))))
|
'(* "--" '(some (if-not "=" 1)) "=" '(any 1))))
|
||||||
@ -30,10 +28,15 @@ Keys are:
|
|||||||
`))
|
`))
|
||||||
|
|
||||||
(def args (tuple/slice process/args 2))
|
(def args (tuple/slice process/args 2))
|
||||||
|
(def todo @[])
|
||||||
(each arg args
|
(each arg args
|
||||||
(if (string/has-prefix? "--" arg)
|
(if (string/has-prefix? "--" arg)
|
||||||
(let [[key value] (peg/match argpeg arg)]
|
(let [[key value] (peg/match argpeg arg)]
|
||||||
(setdyn (keyword key) value))
|
(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))
|
(if (empty? args) (help))
|
||||||
|
Loading…
Reference in New Issue
Block a user