mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-28 10:29:37 +02:00
Resolve "lisbstd.bash: in function std::replace_path use empty string as default for 'replacestr'"
This commit is contained in:
@@ -152,7 +152,7 @@ std::remove_path() {
|
||||
std::replace_path () {
|
||||
local -r path="$1"
|
||||
local -r removepat="$2"
|
||||
local -r replacestr="$3"
|
||||
local -r replacestr="${3:-''}"
|
||||
|
||||
local -r removestr=$(echo "${!path}" | tr ":" "\n" | grep -m 1 "^$removepat\$")
|
||||
export $path="$(echo "${!path}" | tr ":" "\n" | sed "s:^${removestr}\$:${replacestr}:" |
|
||||
|
||||
Reference in New Issue
Block a user