https://github.com/andrewchambers/janet-sh
Shorthand shell like functions for janet.
https://github.com/andrewchambers/janet-sh
Last synced: about 2 months ago
JSON representation
Shorthand shell like functions for janet.
- Host: GitHub
- URL: https://github.com/andrewchambers/janet-sh
- Owner: andrewchambers
- Created: 2019-12-31T05:42:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-09T16:51:36.000Z (over 1 year ago)
- Last Synced: 2025-02-14T12:57:29.864Z (2 months ago)
- Language: Janet
- Homepage:
- Size: 33.2 KB
- Stars: 97
- Watchers: 10
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-janet - janet-sh
README
# janet-sh
The rationale and design is partially covered in a [blog post](https://acha.ninja/blog/dsl_for_shell_scripting/)
## Quick examples
```
(import sh)# raise an error on failure.
(sh/$ touch foo.txt)# raise an error on failure, return command output.
(sh/$< echo "hello world!")
"hello world!\n"# return true or false depending on process success.
(when (sh/$? true)
(print "cool!"))# pipelines
(sh/$ cat ,path | sort | uniq)# pipeline matching
(match (sh/run yes | head -n5)
[0 0] :ok)```