mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
19 lines
463 B
Bash
Executable File
19 lines
463 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
shopt -s globstar
|
|
|
|
if [ "$#" -ne "2" ];
|
|
then
|
|
echo "usage: $0 old_name new_name"
|
|
exit 1
|
|
fi
|
|
|
|
# Rename all instances within text files.
|
|
grep -rl "$1" asm/**/*.s src/**/*.{c,h} lib/**/*.{c,s} include/*.h undefined_syms.txt dkr.ld | xargs sed -i "s/\b$1\b/$2/g"
|
|
|
|
# Rename filenames & directories.
|
|
python3 ./tools/python/rename_file.py "$1" "$2"
|
|
|
|
# This removes all the .o files that use the old name.
|
|
grep -rl "$1" build/**/*.o | xargs rm
|