Move ensureLocalBinFolder to lib.sh
This commit is contained in:
committed by
T. R. Bernstein
parent
2f279a08c7
commit
9f2f5eee57
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user