Private Fork of the QMK keyboard firmware project with my own layout.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.0 KiB

# This script finds all files in keyboards/ subdirectories,
# and deletes the build option filesize impacts from them.
# Print an error message with the word "ERROR" in red.
echo_error() {
echo -e "[\033[0;91mERROR\033[m]: $1"
# If we've been started from util/, we want to be in qmk_firmware/
[[ "$PWD" == *util ]] && cd ..
# The root qmk_firmware/ directory should have a subdirectory called quantum/
if [ ! -d "quantum" ]; then
echo_error "Could not detect the QMK firmware directory!"
echo_error "Are you sure you're in the right place?"
exit 1
# Set the inplace editing parameter for sed.
# macOS/BSD sed expects a file extension immediately following -i.
set_sed_i() {
case $(uname -a) in
*Darwin*) sed_i=(-i "")
# Exclude keyamps/ directories
files=$(find keyboards -type f -name '' -not \( -path '*/keymaps*' -prune \))
# Edit files
for file in $files; do
sed "${sed_i[@]}" -e "s/(+[0-9].*)$//g" "$file"
echo "Cleaned up files."