...
1#!/usr/bin/env -S v run
2// The shebang above associates the file to V on Unix-like systems,
3// so it can be run just by specifying the path to the file
4// once it's made executable using `chmod +x`.
5
6// print command then execute it
7fn sh(cmd string){
8 println("❯ $cmd")
9 print(execute_or_exit(cmd).output)
10}
11
12// Remove if build/ exits, ignore any errors if it doesn't
13rmdir_all('build') or { }
14
15// Create build/, never fails as build/ does not exist
16mkdir('build')?
17
18// Move *.v files to build/
19result := execute('mv *.v build/')
20if result.exit_code != 0 {
21 println(result.output)
22}
23
24sh('ls')
View as plain text