Replace the ~30-line get_script_dir() copy (duplicated a third time from bashrc/bash_profile) with a one-liner. This script is always executed directly, never sourced from another file, so BASH_SOURCE[0] reliably points to itself — the extra logic in get_script_dir() for the sourced-from-elsewhere case doesn't apply here.
14 lines
410 B
Bash
Executable File
14 lines
410 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Define the path to the directory of this file if not already set
|
|
if [ -z "${BASH_CONFIG_DIR}" ]; then
|
|
BASH_CONFIG_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
fi
|
|
|
|
cd "${HOME}" || exit 1
|
|
|
|
ln -sf "${BASH_CONFIG_DIR}"/bash_profile .bash_profile
|
|
ln -sf "${BASH_CONFIG_DIR}"/bashrc .bashrc
|
|
ln -sf "${BASH_CONFIG_DIR}"/bash_logout .bash_logout
|
|
ln -sf "${BASH_CONFIG_DIR}"/inputrc .inputrc
|