fix zoa cp
Jes Olson j3s@c3f.net
Tue, 22 Nov 2022 21:40:35 -0800
3 files changed,
12 insertions(+),
32 deletions(-)
M
shell/shell.go
→
shell/shell.go
@@ -34,7 +34,6 @@ }
} func CallHandler(ctx context.Context, args []string) ([]string, error) { - script := ctx.Value("script").(string) command := args[0] fmt.Println()@@ -43,7 +42,7 @@ if command == "echo" {
color.ZoaSay(`prefer printf over echo! ex: printf '%s\n' "hello world!"`) } - fmt.Printf("%s $ %s\n", script, strings.Join(args, " ")) + fmt.Printf("$ %s\n", strings.Join(args, " ")) return args, nil }
M
test/main
→
test/main
@@ -8,41 +8,22 @@ # hewo
uname -a PASSTHROUGH=bananas -# tests waiting for output -sleep 2; printf '%s\n' hi - -# check all env vars -env - -# ensure comments are ignored -# ls /asfj - -zoa-script 2-call-me-from-anotha - -echo i am main +# test waiting for output, printing a set var +sleep 2; printf '%s\n' "$PASSTHROUGH" # test if statements if [ "$(uname -n)" = "nostromo" ]; then - echo NOSTROMO + printf "%s\n" NOSTROMO fi -echo $NODENAME +printf "%s\n" "$NODENAME" > /tmp/hi -zoa-script 3-more +# ensure that suggestions work in an if statement +if true; then + echo hi +fi -cat >/tmp/trashcan <<EOF -hello i am a trash can man :3 -EOF - -printf "testing passthrough vars: %s\n" $PASSTHROUGH -zoa-file demo /tmp/zoa-file-test echo $PASSTHROUGH -ls /tmp/zoa-file-test - -# ensure that zoa-script works in an if statement -if printf "%s\n" "testing if statement followed by custom helper"; then - zoa-script another-thing -fi +# test zoa cp +zoa cp /tmp/hi /tmp/hi2 0644 # should pass ls /asdfnoexist || true - -ls /