andrewchambers / janet-sh

Shorthand shell like functions for janet.
84 stars 7 forks source link

Add macros sh and sh< for running commands in a real shell #23

Open MaxGyver83 opened 9 months ago

MaxGyver83 commented 9 months ago

Use these macros to run commands in a shell (sh). This allows using shell variables, cd and other shell builtins.

Examples:

(import sh)

(sh/sh cd /tmp && git clone https://github.com/andrewchambers/janet-sh)

(sh/sh<
  if [ "${USER}" = ,(os/getenv "USER") ];
  then echo "it's \"me\""; else echo "not me"; fi)

These things don't work:

To be discussed

This addresses #21 and #22.