Skip to content

Commit

Permalink
Merge pull request #841 from gbdlin/bugfix/update-with-path-containin…
Browse files Browse the repository at this point in the history
…g-whitespaces

fix: Profile path no longer being cut off on space
  • Loading branch information
black7375 authored Dec 14, 2023
2 parents a526a81 + 6ef6a38 commit 8ad8ab1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ write_file() {
get_ini_section() {
local filePath="$1"

local output=$(grep -E "^\[" "${filePath}" |sed -e "s/^\[//g" -e "s/\]$//g")
local output="$(grep -E "^\[" "${filePath}" |sed -e "s/^\[//g" -e "s/\]$//g")"
echo "${output}"
}
get_ini_value() {
Expand All @@ -195,11 +195,11 @@ get_ini_value() {

local output=""
if [ "${section}" == "" ]; then
output=$(grep -E "^${key}" "${filePath}" | cut -f 2 -d"=")
output="$(grep -E "^${key}" "${filePath}" | cut -f 2 -d"=")"
echo "${output}"
else
local sectionStart=""
for line in $(cat "${filePath}"); do
while IFS= read line; do
if [[ "${sectionStart}" == "true" && "${line}" == "["* ]]; then
return 0
fi
Expand All @@ -209,12 +209,12 @@ get_ini_value() {
fi

if [ "${sectionStart}" == "true" ]; then
output=$(echo "${line}" | grep -E "^${key}" | cut -f 2 -d"=" )
output="$(echo "${line}" | grep -E "^${key}" | cut -f 2 -d"=" )"
if [ "${output}" != "" ]; then
echo "${output}"
fi
fi
done
done < "${filePath}"
fi
}

Expand Down Expand Up @@ -543,7 +543,7 @@ write_lepton_info() {
fi
for key in "Type" "Branch" "Ver" "Path"; do
eval "local value=\${${key}}"
output="${output}$(set_ini_value ${key} ${value})"
output="${output}$(set_ini_value "${key}" "${value}")"
done

# Latest element flushing
Expand Down

0 comments on commit 8ad8ab1

Please sign in to comment.