From b5350afe539a05b3934a9de9d2172f090d7041e3 Mon Sep 17 00:00:00 2001 From: Paul Liverman III Date: Wed, 7 Mar 2018 23:23:08 -0800 Subject: [PATCH] added quote fn to shell --- shell.moon | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell.moon b/shell.moon index d4d2bf7..07a8e16 100644 --- a/shell.moon +++ b/shell.moon @@ -1,3 +1,7 @@ +quote = (str) -> + escaped = str\gsub "'", [['"'"']] + return "'#{escaped}'" + execute = (cmd, capture_exit_code=true) -> local handle if capture_exit_code @@ -14,5 +18,6 @@ execute = (cmd, capture_exit_code=true) -> return exit_code, output { + :quote :execute }