mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-24 10:52:52 +00:00
16 lines
425 B
Bash
Executable file
16 lines
425 B
Bash
Executable file
#!/bin/bash
|
|
|
|
CONFIG_H=config-kleopatra.h
|
|
|
|
#
|
|
# Adds #include <$CONFIG_H> to all implementation files,
|
|
# right before the first existing preprocessor directive (^#)
|
|
#
|
|
|
|
my_REPLACEMENT_TEXT='#include <config-kleopatra.h>
|
|
|
|
'
|
|
|
|
find "$@" -name '*.cpp' -o -name '*.cc' -o -name '*.cxx' -o -name '*.c' | \
|
|
xargs grep -LE '# *include *[<"]config-kleopatra.h[>"]' | \
|
|
xargs perl -0777 -pi\~ -e "s/^#/${my_REPLACEMENT_TEXT}#/m;"
|