mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
docs: fix the .vsh doc example (#13645)
This commit is contained in:
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
|
||||
// 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:
|
||||
|
Loading…
Reference in New Issue
Block a user