s
This commit is contained in:
@@ -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) }
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user