From 5c5cdea4f28296f0e7ba1ef6baccc2ed5d8fd28e Mon Sep 17 00:00:00 2001 From: Swastik Baranwal Date: Fri, 18 Oct 2019 22:48:30 +0530 Subject: [PATCH] examples: V script --- examples/v_script.vsh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 examples/v_script.vsh diff --git a/examples/v_script.vsh b/examples/v_script.vsh new file mode 100644 index 0000000000..cab85e7794 --- /dev/null +++ b/examples/v_script.vsh @@ -0,0 +1,39 @@ +fn main() { + + for _ in 0..5 { + println('V script') + } + + println('deploying...') + + println('Files') + foo := ls('.') or { panic(err) } + println(foo) + + println('') + rm('a.out') + + println('Making dir name and creating foo.txt') + mkdir('name') + create('foo.txt') + + foo_ls := ls('.') or { panic(err) } + println(foo_ls) + println('') + + println('Entering into name') + chdir('name') + foo_ls2 := ls('.') or { panic(err) } + println(foo_ls2) + println('') + + println('Removing name and foo.txt') + println('') + chdir('../') + rmdir('name') + rm('foo.txt') + + again := ls('.') or { panic(err) } + println(again) + +}