sbopkg, slapt-{get,src}: expand tilde in config file name

This fixes following [[ -r "$config" ]] when file name begins with ~.
This commit is contained in:
Igor Murzov 2014-06-06 01:18:32 +04:00
parent 154f388413
commit 505481c8cc
3 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,7 @@ _sbopkg()
for (( i=${#words[@]}-1; i>0; i-- )); do for (( i=${#words[@]}-1; i>0; i-- )); do
if [[ "${words[i]}" == -f ]]; then if [[ "${words[i]}" == -f ]]; then
config="${words[i+1]}" config="${words[i+1]}"
__expand_tilde_by_ref config
break break
fi fi
done done

View File

@ -45,6 +45,7 @@ _slapt_get()
for (( i=${#words[@]}-1; i>0; i-- )); do for (( i=${#words[@]}-1; i>0; i-- )); do
if [[ ${words[i]} == -@(c|-config) ]]; then if [[ ${words[i]} == -@(c|-config) ]]; then
config="${words[i+1]}" config="${words[i+1]}"
__expand_tilde_by_ref config
break break
fi fi
done done

View File

@ -41,6 +41,7 @@ _slapt_src()
for (( i=${#words[@]}-1; i>0; i-- )); do for (( i=${#words[@]}-1; i>0; i-- )); do
if [[ ${words[i]} == -@(c|-config) ]]; then if [[ ${words[i]} == -@(c|-config) ]]; then
config="${words[i+1]}" config="${words[i+1]}"
__expand_tilde_by_ref config
break break
fi fi
done done