kiss: contains() fixes and bug fix for repository paths containing spaces.
This commit is contained in:
parent
fc54435595
commit
8dae372609
17
kiss
17
kiss
|
@ -21,7 +21,15 @@ die() {
|
||||||
}
|
}
|
||||||
|
|
||||||
contains() {
|
contains() {
|
||||||
case " $1 " in *" $2 "*) return 0; esac; return 1
|
_sep=${3:- }
|
||||||
|
|
||||||
|
case "${_sep}${1}${_sep}" in
|
||||||
|
*"${_sep}${2}${_sep}"*)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
@ -1198,8 +1206,8 @@ pkg_updates() {
|
||||||
git_root=$(git rev-parse --show-superproject-working-tree)
|
git_root=$(git rev-parse --show-superproject-working-tree)
|
||||||
cd "${git_root:-.}"
|
cd "${git_root:-.}"
|
||||||
|
|
||||||
contains "$repos" "$PWD" || {
|
contains "$repos" "$PWD" : || {
|
||||||
repos="$repos $PWD "
|
repos="$repos:$PWD"
|
||||||
|
|
||||||
# Display a tick if signing is enabled for this repository.
|
# Display a tick if signing is enabled for this repository.
|
||||||
case $(git config merge.verifySignatures) in
|
case $(git config merge.verifySignatures) in
|
||||||
|
@ -1335,7 +1343,8 @@ args() {
|
||||||
case $action in
|
case $action in
|
||||||
a|alternatives|i|install|r|remove)
|
a|alternatives|i|install|r|remove)
|
||||||
[ -z "$1" ] || [ -w "$KISS_ROOT/" ] || [ "$uid" = 0 ] || {
|
[ -z "$1" ] || [ -w "$KISS_ROOT/" ] || [ "$uid" = 0 ] || {
|
||||||
as_root HOME="$HOME" \
|
as_root \
|
||||||
|
HOME="$HOME" \
|
||||||
XDG_CACHE_HOME="$XDG_CACHE_HOME" \
|
XDG_CACHE_HOME="$XDG_CACHE_HOME" \
|
||||||
KISS_CHOICE="$KISS_CHOICE" \
|
KISS_CHOICE="$KISS_CHOICE" \
|
||||||
KISS_COLOR="$KISS_COLOR" \
|
KISS_COLOR="$KISS_COLOR" \
|
||||||
|
|
Loading…
Reference in New Issue