Skip to content

Commit

Permalink
Fix hhs setup (trim) problem
Browse files Browse the repository at this point in the history
  • Loading branch information
yorevs committed Nov 25, 2023
1 parent 6b59919 commit 8158b92
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions bin/apps/bash/hhs-app/functions/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ function setup() {
export HHS_USE_STARSHIP=
")

type trim

echo "S: ${default_settings}" && quit 0

# Regex to match a setting.
re_property="([a-zA-Z0-9 ]+=.*)"

Expand Down Expand Up @@ -87,11 +83,11 @@ function setup() {
name="${setting%%=*}" && value="${setting#*=}"
value="${value//False/}"
value="${value//True/1}"
if ! sed "s/^ *\(export ${name}\)=\(.*\)$/\1=${value}/g" "${HHS_SETUP_FILE}" >"${aux}"; then
if ! sed "s/^\(export ${name}\)=\(.*\)$/\1=${value}/g" "${HHS_SETUP_FILE}" >"${aux}"; then
quit 1 "Unable to change setting: ${setting}!"
fi
\mv "${aux}" "${HHS_SETUP_FILE}"
done
\mv "${aux}" "${HHS_SETUP_FILE}"
quit 0 "${GREEN}HomeSetup settings (${#sel_settings[@]}) saved!${NC}"
else
quit 0 "${YELLOW}HomeSetup settings (${#all_items[@]}) unchanged!${NC}"
Expand Down

0 comments on commit 8158b92

Please sign in to comment.