diff options
author | Be <be@mixxx.org> | 2020-11-24 13:52:10 -0600 |
---|---|---|
committer | Be <be@mixxx.org> | 2020-11-24 13:52:10 -0600 |
commit | b43b37aa10a222fc642f10fa76307dbc418f56da (patch) | |
tree | bd00e2aea1ff929f2e811775cfb194dc2d909b62 | |
parent | 98a2c20de59f5b325888754ae3960552448f9780 (diff) |
macos_buildenv.sh: consolidate duplicated code into a function
-rwxr-xr-x | tools/macos_buildenv.sh | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/tools/macos_buildenv.sh b/tools/macos_buildenv.sh index 0f642e9fc7..70644d7e7a 100755 --- a/tools/macos_buildenv.sh +++ b/tools/macos_buildenv.sh @@ -82,23 +82,21 @@ case "$COMMAND" in export Qt5_DIR="$(find "${BUILDENV_PATH}" -type d -path "*/cmake/Qt5")" export QT_QPA_PLATFORM_PLUGIN_PATH="$(find "${BUILDENV_PATH}" -type d -path "*/plugins")" export PATH="${BUILDENV_PATH}/bin:${PATH}" - - if [ -n "${GITHUB_ENV}" ]; then - { - echo "MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}" - echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" - echo "Qt5_DIR=${Qt5_DIR}" - echo "QT_QPA_PLATFORM_PLUGIN_PATH=${QT_QPA_PLATFORM_PLUGIN_PATH}" - echo "PATH=${PATH}" - } >> "${GITHUB_ENV}" - elif [ "$1" != "--profile" ]; then - echo "" - echo "Exported environment variables:" + + echo_exported_variables() { echo "MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}" echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" echo "Qt5_DIR=${Qt5_DIR}" echo "QT_QPA_PLATFORM_PLUGIN_PATH=${QT_QPA_PLATFORM_PLUGIN_PATH}" echo "PATH=${PATH}" + } + + if [ -n "${GITHUB_ENV}" ]; then + echo_exported_variables >> "${GITHUB_ENV}" + elif [ "$1" != "--profile" ]; then + echo "" + echo "Exported environment variables:" + echo_exported_variables fi ;; esac |