feat: set some defintions at root level

This commit is contained in:
Price Hiller 2022-07-31 21:47:01 -05:00
parent f38fe54387
commit 63d83385e2
2 changed files with 9 additions and 3 deletions

View File

@ -87,6 +87,12 @@ main() {
exit 1
fi
# shellcheck disable=2155
export SOURCE_DIR="$(
# shellcheck disable=2046,2164
cd $(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/dots
pwd
)"
for installer in "${installers[@]}"; do
log "info" "Running installer: ${M_COLOR}${installer}${RESET_BOLD}"
if ! bash "${installer}"; then

View File

@ -2,7 +2,7 @@
set -eo pipefail
DEPS_PATH="${HOME}/.local/share"
SCRIPT_DIR="$( cd $(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/../dots; pwd)"
SOURCE_DIR="$( cd $(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)/../dots; pwd)"
PKG_INSTALL_CMD=""
BOLD=$(tput bold)
@ -211,7 +211,7 @@ deploy-config() {
)
for install_key in "${!install_paths[@]}"; do
local src_path="${SCRIPT_DIR}/${install_paths[${install_key}]}"
local src_path="${SOURCE_DIR}/${install_paths[${install_key}]}"
local dest_path="${HOME}/${install_paths[${install_key}]}"
if [[ -e "${dest_path}" ]]; then
@ -230,7 +230,7 @@ deploy-config() {
main() {
local tasks_done=()
log "info" "Set source directory as ${M_COLOR}${SCRIPT_DIR}${RESET_BOLD}"
log "info" "Set source directory as ${M_COLOR}${SOURCE_DIR}${RESET_BOLD}"
log "info" "Dependencies directory set to ${M_COLOR}${DEPS_PATH}${RESET_BOLD}"
log "info" "Packager install command set to ${M_COLOR}${PKG_INSTALL_CMD}${RESET_BOLD}"
mkdir -p "${DEPS_PATH}"