From 9cc73fd0f84cb2047ab03ce55ef412a6c9545199 Mon Sep 17 00:00:00 2001 From: Devin Bayer Date: Thu, 3 Mar 2022 18:47:05 +0100 Subject: [PATCH] docs: fix the .vsh doc example (#13645) --- doc/docs.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/docs.md b/doc/docs.md index 2a46ccff0e..c7d4d85696 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -5777,6 +5777,12 @@ An example `deploy.vsh`: // so it can be run just by specifying the path to the file // once it's made executable using `chmod +x`. +// print command then execute it +fn sh(cmd string){ + println("❯ $cmd") + print(execute_or_exit(cmd).output) +} + // Remove if build/ exits, ignore any errors if it doesn't rmdir_all('build') or { } @@ -5784,17 +5790,11 @@ rmdir_all('build') or { } mkdir('build') ? // Move *.v files to build/ -result := execute('mv *.v build/') ? +result := execute('mv *.v build/') if result.exit_code != 0 { println(result.output) } -// print command then execute it -fn sh(cmd string){ - println("❯ $cmd") - print(execute_or_exit(cmd).output) -} - sh('ls') // Similar to: