Skip to content

A mini library for janet, inspired by janetsh

Notifications You must be signed in to change notification settings

pepe/janet-sh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

janet-sh

Quick example

(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!"))

# shell helpers

(sh/shell-quote ["hello" "there ' \""])
"'hello' 'there '\\'' \"'"

(sh/pipeline [["ls"] ["sort" "-u"]])
@["/bin/sh" "-c" "'ls' | 'sort' '-u'"] # pass this to a run function.

About

A mini library for janet, inspired by janetsh

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published