diff --git a/scripts/publish.sh b/scripts/publish.sh
index 6bc95f0..3943cde 100755
--- a/scripts/publish.sh
+++ b/scripts/publish.sh
@@ -10,9 +10,9 @@ if git rev-parse "$TAG" >/dev/null 2>&1; then
exit 0
fi
-sed -i -e "s|'com.github.DaikonWeb:daikon:.*'|'com.github.DaikonWeb:daikon:${TAG}'|g" build.gradle
-sed -i -e "s|'com.github.DaikonWeb:${PROJECT_NAME}:.*'|'com.github.DaikonWeb:${PROJECT_NAME}:${TAG}'|g" README.md
-sed -i -e "s|.*|${TAG}|g" README.md
+sed -i -e "s|'com.github.DaikonWeb:daikon:.*'|'com.github.DaikonWeb:daikon:${TAG}'|g" build.gradle && rm build.gradle-e
+sed -i -e "s|'com.github.DaikonWeb:${PROJECT_NAME}:.*'|'com.github.DaikonWeb:${PROJECT_NAME}:${TAG}'|g" README.md && rm README.md-e
+sed -i -e "s|.*|${TAG}|g" README.md && rm README.md-e
git commit -am "Release ${TAG}"
git tag $TAG