Move ensureLocalBinFolder to lib.sh

This commit is contained in:
T. R. Bernstein
2024-07-01 20:08:34 +02:00
committed by T. R. Bernstein
parent 2f279a08c7
commit 9f2f5eee57
2 changed files with 12 additions and 12 deletions

View File

@@ -77,18 +77,6 @@ function ensureHomebrewLogDirectory() {
ensureDirectoryWithDefaultMod ${homebrew_log}
}
function ensureLocalBinFolder() {
local folder="/usr/local/bin"
if [ ! -d "${folder}" ]; then
mkdir -p "${folder}" 2> /dev/null || {
lop -- -e 'Could not create directory' -e $folder
return 10
}
chown root:admin "${folder}"
chmod ug=rwx,o=rx "${folder}"
fi
}
function getHomebrewRepositoryPath() {
local uname_machine=$(/usr/bin/uname -m)
if [[ ${uname_machine} == "arm64" ]]; then

View File

@@ -16,6 +16,18 @@ function isDebug() {
test "${MACOS_SYSTEM_DEBUG}" = true -o "${MACOS_SYSTEM_DEBUG}" = 1
}
function ensureLocalBinFolder() {
local folder="/usr/local/bin"
if [[ ! -d "${folder}" ]]; then
mkdir -p "${folder}" 2> /dev/null || {
lop -- -e 'Could not create directory' -e $folder
return 10
}
chown root:admin "${folder}"
chmod ug=rwx,o=rx "${folder}"
fi
}
function configureLogging() {
local output=tostdout level=info
[ -n "${logfile}" ] && output=${logfile}