small pixel drawing of a pufferfish zoa

fix zoa cp
Jes Olson j3s@c3f.net
Tue, 22 Nov 2022 21:40:35 -0800
commit

cea4afea0b8203d06ab802faa95d759e11a4f1d5

parent

1ffd2b3104158860fe5d053c189ea672a42d40d1

3 files changed, 12 insertions(+), 32 deletions(-)

jump to
M main.gomain.go

@@ -65,10 +65,10 @@ }

shell.ZoaCopy(os.Args[2], os.Args[3], mode) case "version": fmt.Println("0.1.0") - os.Exit(0) default: printUsageExit() } + os.Exit(0) } func zoaRun() {
M shell/shell.goshell/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/maintest/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 /