Fixing SED error. (I Hate sed)

On branch development
 Your branch is up to date with 'origin/development'.

 Changes to be committed:
	modified:   hyprwire.sh
This commit is contained in:
Don Williams 2025-12-29 12:02:40 -05:00
parent 89a837d3c7
commit a8f6e3c530

View File

@ -49,10 +49,16 @@ if git clone --recursive -b "$tag" https://github.com/hyprwm/hyprwire.git; then
#include <iterator> #include <iterator>
#define APPEND_RANGE(vec, ...) (vec).insert((vec).end(), std::begin(__VA_ARGS__), std::end(__VA_ARGS__)) #define APPEND_RANGE(vec, ...) (vec).insert((vec).end(), std::begin(__VA_ARGS__), std::end(__VA_ARGS__))
EOF EOF
# Replace X.append_range(Y) -> APPEND_RANGE(X, Y) # Replace X.append_range(Y) -> APPEND_RANGE(X, Y) only where it appears
git ls-files | grep -E '\\.(c|cc|cpp|cxx|h|hh|hpp)$' | xargs sed -ri 's/([A-Za-z_][A-Za-z0-9_]*)\.append_range\(/APPEND_RANGE(\1, /g' PATCH_FILES=$(grep -RIl --exclude-dir=.git 'append_range\(' . || true)
if [ -n "$PATCH_FILES" ]; then
echo "$PATCH_FILES" | xargs -r sed -ri 's/([A-Za-z_][A-Za-z0-9_]*)\.append_range\(/APPEND_RANGE(\1, /g'
fi
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_CXX_STANDARD=23 -DCMAKE_CXX_FLAGS="-include ${PWD}/append_range_compat.hpp" # Absolute path for forced include
APPEND_HDR="$(pwd)/append_range_compat.hpp"
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_CXX_STANDARD=23 -DCMAKE_CXX_FLAGS="-include ${APPEND_HDR}"
cmake --build build -j "$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)" cmake --build build -j "$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
if [ $DO_INSTALL -eq 1 ]; then if [ $DO_INSTALL -eq 1 ]; then
if sudo cmake --install build 2>&1 | tee -a "$MLOG" ; then if sudo cmake --install build 2>&1 | tee -a "$MLOG" ; then