dot: 去掉 realpath -m 以尽量兼容 FreeBSD (其 realpath 不支持 -m 且行为存在差异)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user