zsh:conf: Set local extendedglob instead of (*)
The * parameter expansion flag was only introduced in zsh-5.9. I
currently use a system that still uses 5.8.1 and thus throws:
conf:29: error in flags
This commit is contained in:
@@ -64,6 +64,9 @@ qr() {
|
|||||||
|
|
||||||
# Edit config file
|
# Edit config file
|
||||||
conf() {
|
conf() {
|
||||||
|
# EXTENDED_GLOB needed for /#
|
||||||
|
emulate -L zsh -o extendedglob
|
||||||
|
|
||||||
local CONF_EDITOR
|
local CONF_EDITOR
|
||||||
if [[ -n "$EDITOR" ]]; then
|
if [[ -n "$EDITOR" ]]; then
|
||||||
CONF_EDITOR="$EDITOR"
|
CONF_EDITOR="$EDITOR"
|
||||||
@@ -91,8 +94,8 @@ conf() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove trailing slashes
|
# remove trailing slashes. needs extendedglob
|
||||||
1="${(*)1%%/#}"
|
1="${1%%/#}"
|
||||||
|
|
||||||
# search for program name in XDG_CONFIG_HOME and $HOME
|
# search for program name in XDG_CONFIG_HOME and $HOME
|
||||||
local CONF_DIR
|
local CONF_DIR
|
||||||
|
|||||||
Reference in New Issue
Block a user