File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ if [[ -f "${old_pw_config}" ]] ; then
2323 migrate () {
2424 local line section=" "
2525 while IFS= read -r line; do
26- line=" $( pw::trim <<< " ${line}" ) "
26+ line=" $( pw::trim " ${line} " ) "
2727 [[ -z " ${line} " ]] && echo >> " ${mig_pw_config} " && continue
2828 [[ " ${line} " == " #" * || " ${line} " == " ;" * ]] && echo " ${line} " >> " ${mig_pw_config} " && continue
2929
Original file line number Diff line number Diff line change 5151}
5252
5353pw::trim () {
54- local line
55- IFS= read -r line || line=" "
54+ local line=" $1 "
5655 line=" ${line# " ${line%% [![:space:]]* } " } "
5756 line=" ${line% " ${line##* [![:space:]]} " } "
5857 printf ' %s' " ${line} "
@@ -85,7 +84,7 @@ pw::parse_config() {
8584
8685 local line section key value
8786 while IFS= read -r line; do
88- line=" $( pw::trim <<< " ${line}" ) "
87+ line=" $( pw::trim " ${line} " ) "
8988 [[ -z ${line} ]] && continue
9089 [[ " ${line} " == " #" * || " ${line} " == " ;" * ]] && continue
9190 # shellcheck disable=SC2016
@@ -95,8 +94,8 @@ pw::parse_config() {
9594 " [keychains]" ) section=" keychains" ;;
9695 \[ * \] ) section=" plugin-${line// [\[\]]/ } " ;;
9796 * )
98- key=" $( pw::trim <<< " ${line%%=*}" ) "
99- value=" $( pw::trim <<< " ${line#*=}" ) "
97+ key=" $( pw::trim " ${line%% =* } " ) "
98+ value=" $( pw::trim " ${line#* =} " ) "
10099 [[ -z ${value} ]] && continue
101100 if [[ " ${section} " == plugin-* ]]; then
102101 section=" ${section# plugin-} "
You can’t perform that action at this time.
0 commit comments