dot: 去掉 realpath -m 以尽量兼容 FreeBSD (其 realpath 不支持 -m 且行为存在差异)

This commit is contained in:
2026-07-18 04:45:40 +08:00
parent eb18384977
commit d9e0ad2e88
9 changed files with 10 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}")) basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
source "${basedir}/function.bash" source "${basedir}/function.bash"
unset basedir unset basedir

View File

@@ -1,4 +1,4 @@
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}")) basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
source "${basedir}/function.bash" source "${basedir}/function.bash"
unset basedir unset basedir

View File

@@ -9,7 +9,7 @@ generate-bash-completion() {
fi fi
local completion_dir="${HOME}/.local/share/bash-completion/completions" local completion_dir="${HOME}/.local/share/bash-completion/completions"
local completion_file="$(realpath -m "${completion_dir}/${file}")" local completion_file="${completion_dir}/${file}"
if [[ -d "$completion_dir" && ! -w "$completion_dir" ]]; then if [[ -d "$completion_dir" && ! -w "$completion_dir" ]]; then
echo "ERROR: has no permission to write to directory '${completion_dir}'" >&2 echo "ERROR: has no permission to write to directory '${completion_dir}'" >&2
@@ -64,7 +64,7 @@ load-bash-completion() {
local completion_dir="${HOME}/.local/share/bash-completion/completions" local completion_dir="${HOME}/.local/share/bash-completion/completions"
for file in "${files[@]}"; do for file in "${files[@]}"; do
local completion_file="$(realpath -m "${completion_dir}/${file}")" local completion_file="${completion_dir}/${file}"
if [[ ! -e "$completion_file" ]]; then if [[ ! -e "$completion_file" ]]; then
if [[ "$silence" == false ]]; then if [[ "$silence" == false ]]; then

View File

@@ -1,4 +1,4 @@
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}")) basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
source "${basedir}/function.bash" source "${basedir}/function.bash"
unset basedir unset basedir

View File

@@ -1,4 +1,4 @@
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}")) basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
source "${basedir}/../function.bash" source "${basedir}/../function.bash"
unset basedir unset basedir

View File

@@ -1,4 +1,4 @@
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}")) basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
source "${basedir}/../function.bash" source "${basedir}/../function.bash"
unset basedir unset basedir

View File

@@ -1,4 +1,4 @@
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}")) basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
source "${basedir}/function.bash" source "${basedir}/function.bash"
unset basedir unset basedir

View File

@@ -1,4 +1,4 @@
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}")) basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
source "${basedir}/function.bash" source "${basedir}/function.bash"
unset basedir unset basedir

View File

@@ -1,4 +1,4 @@
basedir=$(realpath -m $(dirname "${BASH_SOURCE[0]:-$0}")) basedir=$(realpath $(dirname "${BASH_SOURCE[0]:-$0}"))
source "${basedir}/function.bash" source "${basedir}/function.bash"
unset basedir unset basedir