Skip to content
Snippets Groups Projects
Commit 63339d91 authored by Ruben Rodriguez's avatar Ruben Rodriguez
Browse files

Simplified sed wrapper

parent 992ec9d7
No related branches found
No related tags found
No related merge requests found
......@@ -146,7 +146,7 @@ rm /CurrentlyBuilding
umount /proc
}
sedhelper(){
sedhelper2(){
FILE="$1"
EXPR="$2"";"
......@@ -164,6 +164,19 @@ sedhelper(){
done
}
sedhelper(){
FILE="$1"
EXPR="$2"
MD5=$(md5sum "$FILE")
echo Running modification-aware sed: sed "$EXPR" -i "$FILE"
/bin/sed "$EXPR" -i "$FILE"
if [ "$MD5" = "$(md5sum "$FILE")" ]; then
echo File "$FILE" was not modified, stopping.
exit 1
fi
}
sed (){
if ! echo $@ | grep -qw '\-i'; then
echo Running fallback sed: /bin/sed "$@"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment