fix: use robust loop for idempotent header patching to avoid find -exec syntax errors
This commit is contained in:
@ -269,11 +269,13 @@ find src -type f \( -name "*.h" -o -name "*.cpp" \) -exec sed -i 's/std::std::/s
|
|||||||
find src -type f \( -name "*.h" -o -name "*.cpp" \) -exec sed -i 's/\([^:a-zA-Z0-9]\)unique_ptr\b/\1std::unique_ptr/g' {} +
|
find src -type f \( -name "*.h" -o -name "*.cpp" \) -exec sed -i 's/\([^:a-zA-Z0-9]\)unique_ptr\b/\1std::unique_ptr/g' {} +
|
||||||
find src -type f \( -name "*.h" -o -name "*.cpp" \) -exec sed -i 's/\([^:a-zA-Z0-9]\)make_unique\b/\1std::make_unique/g' {} +
|
find src -type f \( -name "*.h" -o -name "*.cpp" \) -exec sed -i 's/\([^:a-zA-Z0-9]\)make_unique\b/\1std::make_unique/g' {} +
|
||||||
|
|
||||||
# Add memory header only if not present
|
# Add headers only if not present
|
||||||
find src -type f -name "*.h" -exec grep -q "<memory>" {} || sed -i '1i #include <memory>' {} +
|
for f in $(find src -type f -name "*.h"); do
|
||||||
|
grep -q "<memory>" "$f" || sed -i '1i #include <memory>' "$f"
|
||||||
# 3. Fix missing algorithms (std::find, etc)
|
done
|
||||||
find src -type f -name "*.cpp" -exec grep -q "<algorithm>" {} || sed -i '1i #include <algorithm>' {} +
|
for f in $(find src -type f -name "*.cpp"); do
|
||||||
|
grep -q "<algorithm>" "$f" || sed -i '1i #include <algorithm>' "$f"
|
||||||
|
done
|
||||||
|
|
||||||
# Build Example (Force C++17 for better compatibility with this addon)
|
# Build Example (Force C++17 for better compatibility with this addon)
|
||||||
cd "$REAL_HOME/openFrameworks/addons/ofxPiMapper/example_basic"
|
cd "$REAL_HOME/openFrameworks/addons/ofxPiMapper/example_basic"
|
||||||
|
|||||||
Reference in New Issue
Block a user