use positional arguments when building the remote build command

Wed, 17 Dec 2025 21:02:28 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 17 Dec 2025 21:02:28 +0100
changeset 6
66cb1937078f
parent 5
08333803df48
child 7
ec0d28411e6a

use positional arguments when building the remote build command

src/main.go file | annotate | diff | comparison | revisions
--- a/src/main.go	Wed Dec 17 20:26:40 2025 +0100
+++ b/src/main.go	Wed Dec 17 21:02:28 2025 +0100
@@ -297,7 +297,7 @@
 
 		// run build.sh
 		build_dir := "build"
-		remote_command := fmt.Sprintf("sh -c 'rm -Rf %s; mkdir -p %s; gzip -dc build.tar.gz | tar xf - -C %s ; (cd %s; ./build.sh)'", build_dir, build_dir, build_dir, build_dir)
+		remote_command := fmt.Sprintf("sh -c 'rm -Rf %[1]s; mkdir -p %[1]s; gzip -dc build.tar.gz | tar xf - -C %[1]s ; (cd %[1]s; ./build.sh)'", build_dir)
 		log.Printf("host: %s: command: %s", env.Host, remote_command)
 
 		var outb, errb bytes.Buffer

mercurial