Skip to content

Commit

Permalink
feat(webi-essentials+bsd): support 'pkg_add'
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Jan 16, 2024
1 parent 7ea58dc commit c431ce0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion webi-essentials/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ _install_webi_essentials() { (
fi
fi

printf '%s' " $(t_dim 'Checking for apt/apk ...')"
printf '%s' " $(t_dim 'Checking for apt/apk/pkg_add ...')"
if command -v apt > /dev/null; then
echo " $(t_pkg 'apt')"
_install_webi_essentials_apt "${cmd_sudo}" "${b_pkgs}"
Expand All @@ -195,6 +195,13 @@ _install_webi_essentials() { (
return 0
fi

if command -v pkg_add > /dev/null; then
echo " $(t_pkg 'pkg_add')"
_install_webi_essentials_pkg_add "${cmd_sudo}" "${b_pkgs}"
echo " $(t_dim 'OK')"
return 0
fi

echo " $(t_dim 'none')"
_install_webi_essentials_webi "${cmd_sudo}" "${b_pkgs}"
echo " $(t_dim 'OK')"
Expand Down Expand Up @@ -230,6 +237,16 @@ _install_webi_essentials_apk() { (
${cmd_sudo} apk add --no-cache ${b_pkgs}
); }

_install_webi_essentials_pkg_add() { (
cmd_sudo="${1}"
b_pkgs="${2}"

echo " $(t_dim 'Running') $(t_cmd "${cmd_sudo}pkg_add")"
fn_polite_sudo "${cmd_sudo}" " $(t_cmd "pkg_add ${b_pkgs}")"
# shellcheck disable=SC2086
${cmd_sudo} pkg_add ${b_pkgs}
); }

_install_webi_essentials_webi() { (
cmd_sudo="${1}"
b_pkgs="${2}"
Expand Down

0 comments on commit c431ce0

Please sign in to comment.