Closed paulsnar closed 2 years ago
This should only happen if the bundle type is git, which makes sense. A better solution is to simply avoid this code path if a .git directory is not present for a project - we can just check for .git or something similar.
That does indeed work better, thanks!
Manifest generation shells out to Git to get the remote URL and the current commit hash:
https://github.com/janet-lang/jpm/blob/5dd1ab7780eeb967dc7fad8e9af3d071f50e6fca/jpm/declare.janet#L320-L323
If this is performed for a project which doesn't have a Git repo, Git exits with status code 128 and an error message about .git being nonexistent:
Given that ff61f1ada74626fdd8aa95a360ca0a1b7ba0223e changed how process slurping works, this basically boils down to the
:x
flag being passed to os/spawn here:https://github.com/janet-lang/jpm/blob/ff61f1ada74626fdd8aa95a360ca0a1b7ba0223e/jpm/shutil.janet#L119
If this is removed and
nil
is returned fromexec-slurp
on non-zero exit code, all is well. I've made a basic patch at https://github.com/paulsnar/janet-jpm/commit/3e31f2df6638fd5851ec2eedd9f1eaba11be549a that does just that, though it's maybe not the cleanest approach (perhaps stderr could be swallowed too in this case.)