]> git.xolatile.top Git - emil-bake.git/commitdiff
fixed shake eval yet again
authorEmil Williams <emilwilliams@tuta.io>
Wed, 24 Jan 2024 14:00:46 +0000 (14:00 +0000)
committerEmil Williams <emilwilliams@tuta.io>
Wed, 24 Jan 2024 14:00:46 +0000 (14:00 +0000)
install.sh
shake

index cf35974ed2e367c5702b3c3f1edde732e13c7a6a..1fe35d65689ad4471d2a79ecfb9b856469112680 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 cd $(dirname "$(readlink -f "$0")")
-SUDO=${SUDO:-sudo}
+SUDO=${SUDO-sudo}
 chmod +x shake
 ./shake bake.c -s $@ && \
 $SUDO install -m 755 shake bake ${TARGET:-/usr/local/bin}
diff --git a/shake b/shake
index a6ffd842ac7630ed49f15c63196981159d16e487..59a40ef015d7ec9583916b879b18a0adc8c2cc25 100755 (executable)
--- a/shake
+++ b/shake
@@ -60,10 +60,11 @@ line=${line//\$+/$@}
 
 if [[ -n $line ]]; then
     command="${line#*${MARK}}"
+    command=$(echo $command | sed 's/[^\\]\?#.*//')
     echo "Exec: $command"
     if [[ $run -eq 1 ]]; then
         echo "Output:"
-        $command
+        sh -c "$command"
     fi
 else
     echo -e "${MARKSTR} is not defined." >&2