Files
config-bash/create-links.bash
T
xavier 1a7a850efa fix: Simplify create-links.bash path resolution
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.
2026-08-22 02:16:49 +02:00

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