diff --git a/cli/compile_upload.vsh b/cli/compile_upload.vsh index 6ec88872..d58246b0 100755 --- a/cli/compile_upload.vsh +++ b/cli/compile_upload.vsh @@ -90,5 +90,6 @@ fn hero_upload() ! { fn main() { //os.execute_or_panic('${os.home_dir()}/code/github/freeflowuniverse/herolib/cli/compile.vsh -p') + os.execute_or_panic('${os.home_dir()}/code/github/freeflowuniverse/herolib/cli/compile.vsh') hero_upload() or { eprintln(err) exit(1) } } diff --git a/cli/hero.v b/cli/hero.v index 3535fbfa..69873d69 100644 --- a/cli/hero.v +++ b/cli/hero.v @@ -31,7 +31,7 @@ fn do() ! { mut cmd := Command{ name: 'hero' description: 'Your HERO toolset.' - version: '2.0.2' + version: '2.0.4' } // herocmds.cmd_run_add_flags(mut cmd) diff --git a/lib/installers/web/bun/bun_actions.v b/lib/installers/web/bun/bun_actions.v index 13c9af1c..c321d1b8 100644 --- a/lib/installers/web/bun/bun_actions.v +++ b/lib/installers/web/bun/bun_actions.v @@ -15,15 +15,18 @@ import os // checks if a certain version or above is installed fn installed() !bool { - res := os.execute('${osal.profile_path_source_and()!} bun -version') + checkcmd:='${osal.profile_path_source_and()!} bun -version' + res := os.execute(checkcmd) if res.exit_code != 0 { + println(res) + println(checkcmd) return false } r := res.output.split_into_lines().filter(it.trim_space().len > 0) if r.len != 1 { return error("couldn't parse bun version.\n${res.output}") } - // println(" ${texttools.version(version)} <= ${texttools.version(r[0])}") + println(" ${texttools.version(version)} <= ${texttools.version(r[0])}") if texttools.version(version) <= texttools.version(r[0]) { return true } diff --git a/lib/osal/cmds.v b/lib/osal/cmds.v index b27871f7..4aa8fd2d 100644 --- a/lib/osal/cmds.v +++ b/lib/osal/cmds.v @@ -109,22 +109,24 @@ pub fn profile_path_source() !string { } pp := profile_path()! if os.exists(pp) { - return 'source ${pp}' + res := os.execute("source ${pp}") + if res.exit_code != 0 { + console.print_stderr("WARNING: your profile is corrupt: ${pp}") + return error("profile corrupt") + }else{ + return 'source ${pp}' + } } return '' } // return source $path && . // or empty if it doesn't exist -pub fn profile_path_source_and() !string { - if core.hostname() or { '' } == 'rescue' { - return '' +pub fn profile_path_source_and() !string { + p:=profile_path_source() or { + return "" } - pp := profile_path()! - if os.exists(pp) { - return '. ${pp} &&' - } - return '' + return '${p} && ' } fn profile_paths_get(content string) []string {