Browse Source

fix: dev: [nextcloud] make ``nextcloud:config:simple:add`` support wider range of chars

Note: especially forward slashes ``/`` are now usable as values in
config.
master
Valentin Lab 7 days ago
parent
commit
6ee3f86553
  1. 4
      nextcloud/lib/common

4
nextcloud/lib/common

@ -186,9 +186,9 @@ nextcloud:config:simple:add() {
fi
if grep "^ '$key' => '" "$CONFIGFILE" >/dev/null; then
sed -ri "s/^( '$key' => ')(.*)(',)$/\1${value}\3/g" "$CONFIGFILE"
sed -ri "s|^( '$key' => ')(.*)(',)$|\1${value}\3|g" "$CONFIGFILE"
return 0
fi
## Add '$key' => 'value', to the end of the file, before the closing paren.
sed -ri "s/^(\);)$/ '$key' => '${value}',\n\1/g" "$CONFIGFILE"
sed -ri "s|^(\);)$| '$key' => '${value}',\n\1|g" "$CONFIGFILE"
}
Loading…
Cancel
Save