docs: fix the .vsh doc example (#13645)
parent
4331d6dea0
commit
9cc73fd0f8
14
doc/docs.md
14
doc/docs.md
|
@ -5777,6 +5777,12 @@ An example `deploy.vsh`:
|
||||||
// so it can be run just by specifying the path to the file
|
// so it can be run just by specifying the path to the file
|
||||||
// once it's made executable using `chmod +x`.
|
// 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
|
// Remove if build/ exits, ignore any errors if it doesn't
|
||||||
rmdir_all('build') or { }
|
rmdir_all('build') or { }
|
||||||
|
|
||||||
|
@ -5784,17 +5790,11 @@ rmdir_all('build') or { }
|
||||||
mkdir('build') ?
|
mkdir('build') ?
|
||||||
|
|
||||||
// Move *.v files to build/
|
// Move *.v files to build/
|
||||||
result := execute('mv *.v build/') ?
|
result := execute('mv *.v build/')
|
||||||
if result.exit_code != 0 {
|
if result.exit_code != 0 {
|
||||||
println(result.output)
|
println(result.output)
|
||||||
}
|
}
|
||||||
|
|
||||||
// print command then execute it
|
|
||||||
fn sh(cmd string){
|
|
||||||
println("❯ $cmd")
|
|
||||||
print(execute_or_exit(cmd).output)
|
|
||||||
}
|
|
||||||
|
|
||||||
sh('ls')
|
sh('ls')
|
||||||
|
|
||||||
// Similar to:
|
// Similar to:
|
||||||
|
|
Loading…
Reference in New Issue