Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rootiest committed Aug 12, 2023
1 parent 07d7a4c commit 2f3c351
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion extras/tool_swap/tool_swap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ fi

# Use sed to search for the regex pattern and replace the matching line with the replace string
temp_file=$(mktemp)
# shellcheck disable=SC1003
sed -e '/\[include tool[0-9]\+\.cfg\]/c\'"$replace_string" "$filename" > "$temp_file"

# Check if any changes were made
Expand All @@ -67,7 +68,7 @@ then
else
# Check if more than one occurrence of the regex pattern was found
occurrences=$(grep -c '\[include tool[0-9]\+\.cfg\]' "$filename")
if [ $occurrences -gt 1 ]
if [ "$occurrences" -gt 1 ]
then
echo "Error: More than one occurrence of the regex pattern was found."
exit 1
Expand Down

0 comments on commit 2f3c351

Please sign in to comment.