[Reproducible-commits] [blog] 01/01: add --dry-run option

Holger Levsen holger at layer-acht.org
Sun May 1 10:50:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository blog.

commit 354d09d77ddfb85cb675d5a02a24c7d004484413
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sun May 1 12:50:33 2016 +0200

    add --dry-run option
---
 bin/guess_tags.sh | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/bin/guess_tags.sh b/bin/guess_tags.sh
index 8701d73..3bc11ca 100755
--- a/bin/guess_tags.sh
+++ b/bin/guess_tags.sh
@@ -1,5 +1,11 @@
 #!/bin/bash
 
+DRYRUN=false
+if [ "$1" = "-d" ] || [ "$1" = "--dry-run" ] ; then
+	DRYRUN=true
+	shift
+fi
+
 if [ "$1" = "" ] ; then
 	echo "need a post number to act on, eg 53"
 	exit 1
@@ -26,7 +32,11 @@ for TAG in $KNOWN_TAGS ; do
 done
 
 if [ ! -f ./drafts/$WEEK.tags ] ; then
-	echo "Creating $WEEK.tags, please review detected tags:"
-	echo "  $MY_TAGS"
-	echo $MY_TAGS > ./drafts/$WEEK.tags
+	if ! $DRYRUN ; then
+		echo "Creating $WEEK.tags, please review detected tags:"
+		echo "  $MY_TAGS"
+		echo $MY_TAGS > ./drafts/$WEEK.tags
+	else
+		echo "Tags guessed: $MY_TAGS"
+	fi
 fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/blog.git



More information about the Reproducible-commits mailing list