Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

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)

```