This commit is contained in:
2025-02-19 09:46:41 +03:00
parent 24eb709293
commit ff45beac09
8 changed files with 25 additions and 29 deletions

View File

@@ -10,9 +10,10 @@ import os
const wikipath = os.dir(@FILE) + '/wiki'
const summarypath = os.dir(@FILE) + '/wiki/summary.md'
buildpath := '${os.home_dir()}/hero/var/mdbuild/bizmodel'
mut m := bizmodel.getset("example")!
mut m := bizmodel.getset('example')!
m.workdir = wikipath
m.play(mut playbook.new(path: wikipath)!)!
m.export_sheets()!
@@ -21,7 +22,6 @@ bizmodel.set(m)
// // execute the actions so we have the info populated
// // playcmds.run(mut plb,false)!
// // just run the doctree & mdbook and it should
// // load the doctree, these are all collections
// mut tree := doctree.new(name: 'bizmodel')!

View File

@@ -1 +0,0 @@
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run

View File

@@ -1 +0,0 @@
#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals run

View File

@@ -47,7 +47,7 @@ fn args_get(path string) !GeneratorArgs {
classname: p.get('classname')!
title: p.get_default('title', '')!
default: p.get_default_true('default')
supported_platforms: p.get_list_default('supported_platforms',[])!
supported_platforms: p.get_list_default('supported_platforms', [])!
singleton: p.get_default_false('singleton')
templates: p.get_default_false('templates')
reset: p.get_default_false('reset')

View File

@@ -38,7 +38,6 @@ pub fn cmd_docusaurus(mut cmdroot Command) {
description: 'Path where docusaurus source is.'
})
cmd_run.add_flag(Flag{
flag: .string
required: false
@@ -87,7 +86,6 @@ pub fn cmd_docusaurus(mut cmdroot Command) {
description: 'Run your dev environment on local browser.'
})
cmd_run.add_flag(Flag{
flag: .bool
required: false
@@ -96,7 +94,6 @@ pub fn cmd_docusaurus(mut cmdroot Command) {
description: 'create a new docusaurus site.'
})
cmdroot.add_command(cmd_run)
}
@@ -120,12 +117,12 @@ fn cmd_docusaurus_execute(cmd Command) ! {
mut docs := docusaurus.new(update: update)!
mut site := docs.get(
url: url
path: path
update: update
publish_path: publish_path
deploykey: deploykey
init:init
url: url
path: path
update: update
publish_path: publish_path
deploykey: deploykey
init: init
)!
if publish_path.len > 0 {

View File

@@ -29,11 +29,11 @@ pub fn get_no_check(path_ string) Path {
@[params]
pub struct GetArgs {
pub mut:
path string
create bool
check bool = true // means will check the dir, link or file exists
empty bool // will empty the dir or the file
delete bool
path string
create bool
check bool = true // means will check the dir, link or file exists
empty bool // will empty the dir or the file
delete bool
increment bool // will increment filename until free name available (filename1...)
}
@@ -84,11 +84,13 @@ pub fn get_file(args_ GetArgs) !Path {
p2.check()
if args.increment {
if p2.exists() {
incr := if args.path[args.path.len-1].is_digit() {
args.path[args.path.len-1].ascii_str().int()
} else {0}
return get_file(GetArgs {...args, path: '${args.path}${incr}'})
if p2.exists() {
incr := if args.path[args.path.len - 1].is_digit() {
args.path[args.path.len - 1].ascii_str().int()
} else {
0
}
return get_file(GetArgs{ ...args, path: '${args.path}${incr}' })
}
}
if args.create {

View File

@@ -1,4 +1,4 @@
module texttools
module texttools
pub fn snake_case(s string) string {
return separate_words(s).join('_')
@@ -35,4 +35,4 @@ fn separate_words(s string) []string {
words << word.to_lower()
}
return words
}
}

View File

@@ -71,13 +71,12 @@ pub fn (repo GitRepo) get_relative_path() !string {
return mypath.path_relative(repo_.gs.coderoot.path) or { panic("couldn't get relative path") }
}
//path where we use ~ and its the full path
// path where we use ~ and its the full path
pub fn (repo GitRepo) get_human_path() !string {
mut mypath := repo.patho()!.path.replace(os.home_dir(),"~")
mut mypath := repo.patho()!.path.replace(os.home_dir(), '~')
return mypath
}
pub fn (mut repo GitRepo) get_parent_dir(args GetParentDir) !string {
repo_path := repo.path()
parent_dir := os.dir(repo_path)