Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewchambers/janet-sh
Shorthand shell like functions for janet.
https://github.com/andrewchambers/janet-sh
Last synced: 1 day 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-09T16:51:36.000Z (10 months ago)
- Last Synced: 2024-11-05T03:36:21.651Z (4 days ago)
- Language: Janet
- Homepage:
- Size: 33.2 KB
- Stars: 87
- Watchers: 8
- Forks: 8
- 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)```