1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-25 07:50:27 +00:00

Update changelog and sort listing.

This commit is contained in:
Calvin Rose 2020-07-05 17:49:48 -05:00
parent a45509d28e
commit 3358811788
2 changed files with 17 additions and 7 deletions

View File

@ -2,6 +2,7 @@
All notable changes to this project will be documented in this file.
## Unreleased - ???
- Add `jpm list-pkgs` subcommand to see which package aliases are in the listing.
- Add `jpm list-installed` subcommand to see which packages are installed.
- Add `math/int-min`, `math/int-max`, `math/int32-min`, and `math/int32-max` for getting integer limits.
- The gc interval is now autotuned, to prevent very bad gc behavior.

23
jpm
View File

@ -1191,17 +1191,26 @@ Flags are:
(defn list-installed
[]
(each x (os/dir (find-manifest-dir))
(if (string/has-suffix? ".jdn" x)
(print (string/slice x 0 -5)))))
(def xs
(seq [x :in (os/dir (find-manifest-dir))
:when (string/has-suffix? ".jdn" x)]
(string/slice x 0 -5)))
(sort xs)
(each x xs (print x)))
(defn list-pkgs
[&opt search]
(def [ok _] (module/find "pkgs"))
(unless ok
(eprint "no local package listing found. Run `jpm update-pkgs` to get listing.")
(os/exit 1))
(def pkgs-mod (require "pkgs"))
(eachk p (get-in pkgs-mod ['packages :value] [])
(if search
(if (string/find search p) (print p))
(print p))))
(def ps
(seq [p :keys (get-in pkgs-mod ['packages :value] [])
:when (if search (string/find search p) true)]
p))
(sort ps)
(each p ps (print p)))
(defn update-pkgs
[]