1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-18 19:29:56 +00:00

Remove use of cd in make-lockfile.

This commit is contained in:
Calvin Rose 2020-03-26 00:12:18 -05:00
parent 6e8aac984f
commit d2d0300c7e

View File

@ -683,14 +683,12 @@ int main(int argc, const char **argv) {
(def cwd (os/cwd))
(def packages @[])
# Read installed modules from manifests
(os/cd (find-manifest-dir))
(defer (os/cd cwd)
(each man (os/dir ".")
(def package (parse (slurp man)))
(if (or (not package :repo) (not package :sha))
(print "Cannot add local package " man " to lockfile, skipping...")
(array/push packages package))
(os/cd "..")))
(def mdir (find-manifest-dir))
(each man (os/dir mdir)
(def package (parse (slurp (string mdir sep man))))
(if (or (not (package :repo)) (not (package :sha)))
(print "Cannot add local package " man " to lockfile, skipping...")
(array/push packages package)))
# Put in correct order, such that a package is preceded by all of its dependencies
(def ordered-packages @[])
(def resolved @{})