This commit is contained in:
2025-02-09 08:55:01 +01:00
parent 1d631fec21
commit 7b69719f0e
38 changed files with 798 additions and 918 deletions

View File

@@ -53,9 +53,9 @@ pub fn package_install(name_ string) ! {
platform_ := core.platform()!
cpu := core.cputype()!
mut sudo_pre:=""
mut sudo_pre := ''
if core.sudo_required()! {
sudo_pre="sudo "
sudo_pre = 'sudo '
}
if platform_ == .osx {
if cpu == .arm {
@@ -68,10 +68,11 @@ pub fn package_install(name_ string) ! {
}
}
} else if platform_ == .ubuntu {
exec(cmd: 'export DEBIAN_FRONTEND=noninteractive && ${sudo_pre}apt install -y ${name} -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --allow-downgrades --allow-remove-essential --allow-change-held-packages')
or { return error('could not install package on Ubuntu: ${name}\nerror:\n${err}')}
exec(
cmd: 'export DEBIAN_FRONTEND=noninteractive && ${sudo_pre}apt install -y ${name} -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --allow-downgrades --allow-remove-essential --allow-change-held-packages'
) or { return error('could not install package on Ubuntu: ${name}\nerror:\n${err}') }
} else if platform_ == .alpine {
exec(cmd: "${sudo_pre}apk add ${name}") or {
exec(cmd: '${sudo_pre}apk add ${name}') or {
return error('could not install package on Alpine: ${name}\nerror:\n${err}')
}
} else if platform_ == .arch {