Process the last line of the override file separately

If it doesn't end with a newline
pull/754/head
probonopd 5 months ago
parent b95efd30f0
commit da7c35ff3f
  1. 4
      hwconfig/DT-DX.override
  2. 9
      hwconfig/customize.sh

@ -43,6 +43,4 @@ LongPressTimeout=400
EncoderEnabled=1
EncoderPinClock=6
EncoderPinData=5
# Do not delete this line
EncoderPinData=5

@ -16,5 +16,14 @@ for file in *.override; do
sed -i "s/^$key=.*/$key=$value/" "$name_of_ini_file"
fi
done < "$file"
# Process the last line of the override file separately, if it doesn't end with a newline
if [ -n "$key" ]; then
value=$(echo "$value" | tr -d '\r')
if [ -n "$value" ]; then
sed -i "s/^$key=.*/$key=$value/" "$name_of_ini_file"
fi
fi
echo "Created $name_of_ini_file"
done

Loading…
Cancel
Save