Skip to content

Commit

Permalink
fix: include value type check for numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
decipher3114 committed Dec 22, 2024
1 parent c0476a6 commit 4841a61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/json/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ editOptions() {
if [ "${NEW_VALUE[*]}" == "${CURRENT_VALUE[*]}" ]; then
break
fi
if [[ $TYPE == "Number" && ! "${NEW_VALUE[*]}" =~ ^[0-9]+$ ]]; then
notify msg "This field should contain only numbers."
continue
fi
if UPDATED_OPTIONS=$(jq -e --arg SELECTED_OPTION "$SELECTED_OPTION" --arg TYPE "$TYPE" '
map(
.key as $KEY |
Expand Down

0 comments on commit 4841a61

Please sign in to comment.