This commit is contained in:
2025-02-03 14:02:26 +03:00
parent 2d17938c75
commit 9aee672450
4 changed files with 18 additions and 12 deletions

View File

@@ -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
}