andrewchambers / janetsh

A powerful new shell that uses the janet programming language for both the implementation and repl.
https://janet-shell.org
MIT License
372 stars 13 forks source link

Move default get-completions to sh.janet and add tests #197

Closed ALSchwalm closed 5 years ago

ALSchwalm commented 5 years ago

Fixes #184

Definitely possible there are some more test cases I'm missing. If so please point them out. I also had to call out to chmod to set the executable bit (kind of wondering if there should be a os/chmod even though that's probably a portability nightmare). Hopefully that is available in the runner.

Edit: Oh, it looks like the interface to os/execute has changed pretty recently. Not sure what the right play is here. Can the runner janet version be updated?

andrewchambers commented 5 years ago

Fixes #184

I also had to call out to chmod to set the executable bit (kind of wondering if there should be a os/chmod even though that's probably a portability nightmare). Hopefully that is available in the runner.

It should be fine, chmod will be everywhere. I agree it could be in the stdlib, we could also just put a c version in shlib, though just for a test might not be needed.

Can the runner janet version be updated?

Yup, the janet version used by the runners is defined in support/ci.sh and is easy to update.

ALSchwalm commented 5 years ago

Sorry for all the force pushes. It looks like recent commits on Janet fail to build on BSD (I'm guessing since this: https://github.com/janet-lang/janet/commit/c43aaf898608840051378e77da8b5bddeaa60bee). But I also need the more recent commit for passing custom environments to all-bindings, so there is no version of Janet that will make this work atm.

andrewchambers commented 5 years ago

@ALSchwalm I just told @bakpakin on gitter.

andrewchambers commented 5 years ago

@ALSchwalm new janet commit to try.

ALSchwalm commented 5 years ago

Yep, that fixed it. Thanks!

andrewchambers commented 5 years ago

Thanks for doing this tidying work, I really appreciate it.