diff --git a/auxbin/jpm b/auxbin/jpm index e1bebbe5..94c1f6fe 100755 --- a/auxbin/jpm +++ b/auxbin/jpm @@ -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 @{})