add build.vsh

This commit is contained in:
Caznix 2024-07-28 15:13:01 -04:00
parent b0c85e5614
commit 9e4c713c24
6 changed files with 74 additions and 9 deletions

8
.editorconfig Normal file
View file

@ -0,0 +1,8 @@
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.v]
indent_style = tab

7
.gitattributes vendored Normal file
View file

@ -0,0 +1,7 @@
* text=auto eol=lf
*.bat eol=crlf
**/*.v linguist-language=V
**/*.vv linguist-language=V
**/*.vsh linguist-language=V
**/v.mod linguist-language=V

24
.gitignore vendored Normal file
View file

@ -0,0 +1,24 @@
# Binaries for programs and plugins
main
comet
*.exe
*.exe~
*.so
*.dylib
*.dll
# Ignore binary output folders
bin/
# Ignore common editor/system specific metadata
.DS_Store
.idea/
.vscode/
*.iml
# ENV
.env
# vweb and database
*.db
*.js

17
build.vsh Normal file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env -S v
fn sh(cmd string) {
println('> ${cmd}')
print(execute_or_exit(cmd).output)
}
sh('ls')
rmdir_all('build') or {}
mkdir('build')!
result := execute('mv *.v build/')
if result.exit_code ! /= {
println(result.output)
}

View file

@ -2,12 +2,20 @@ module initalizer
import os
pub const working_dir = os.home_dir() + '/.comet'
struct State {
uninitalized int
initalized int
}
pub fn check_initalization() !bool {
if ! os.exists(working_dir) {
println('it doesnt exist')
return true
} else {
return false
}
}
fn initalize(init_type int) {
pub fn initalize() {
println("test initalize")
}

View file

@ -5,13 +5,20 @@ import cli
import initalizer
fn main() {
mut app := cli.Command{
name: 'Comet'
description: 'The package manager you never knew you needed'
usage: 'test'
pre_execute: fn (cmd cli.Command) ! {
if initalizer.check_initalization() ! {
println('initalization required')
}
}
execute: fn (cmd cli.Command) ! {
println('asdfasd')
initalizer.initalize()
return
}
commands: [
@ -27,12 +34,6 @@ fn main() {
println('test')
}
}
cli.Command{
name: 'sd'
execute: fn (cmd cli.Command) ! {
cli.print_help_for_command(cmd) !
}
}
]
}
app.setup()