From 9f2f5eee571b9b6763e4f988ee1fabf6e43e1da2 Mon Sep 17 00:00:00 2001 From: "T. R. Bernstein" <137705289+trbernstein@users.noreply.github.com> Date: Mon, 1 Jul 2024 20:08:34 +0200 Subject: [PATCH] Move ensureLocalBinFolder to lib.sh --- modules/03-install-brew.sh | 12 ------------ modules/lib.sh | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/03-install-brew.sh b/modules/03-install-brew.sh index 7650c75..1a2f9b4 100755 --- a/modules/03-install-brew.sh +++ b/modules/03-install-brew.sh @@ -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 diff --git a/modules/lib.sh b/modules/lib.sh index fd30293..90d0e9e 100644 --- a/modules/lib.sh +++ b/modules/lib.sh @@ -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}