[nautilus-actions] Add some checks to script tools



commit d9b527076bf679e33c262a364702ced6ebd24e61
Author: Pierre Wieser <pwieser trychlos org>
Date:   Wed Jan 19 23:55:43 2011 +0100

    Add some checks to script tools
    
    + tools/check-headers.sh
    + tools/check-po.sh

 tools/check-headers.sh |   10 ++++++++--
 tools/check-po.sh      |    4 ++--
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/tools/check-headers.sh b/tools/check-headers.sh
index 4db6fda..aced312 100755
--- a/tools/check-headers.sh
+++ b/tools/check-headers.sh
@@ -106,8 +106,8 @@ function msg_help
 
 function msg_version
 {
-	pck_name=$(grep '^PACKAGE_NAME' Makefile | awk '{ print $3 }')
-	pck_version=$(grep '^PACKAGE_VERSION' Makefile | awk '{ print $3 }')
+	pck_name=$(grep '^PACKAGE_NAME' Makefile 2>/dev/null | awk '{ print $3 }')
+	pck_version=$(grep '^PACKAGE_VERSION' Makefile 2>/dev/null | awk '{ print $3 }')
 	echo "
  ${pck_name} v ${pck_version}
  Copyright (C) 2011 Pierre Wieser."
@@ -286,6 +286,12 @@ if [ "${opt_version}" = "yes" ]; then
 	exit
 fi
 
+if [ "$(basename $(pwd))" != "nautilus-actions" ]; then
+	msgerr "current directory is $(pwd)"
+	msg "you should change to nautilus-actions/"
+	let errs+=1
+fi
+
 if [ ${errs} -gt 0 ]; then
 	msg "${errs} error(s) have been detected"
 	msg "try '${my_cmd} --help' for usage"
diff --git a/tools/check-po.sh b/tools/check-po.sh
index 450fab0..3db812f 100755
--- a/tools/check-po.sh
+++ b/tools/check-po.sh
@@ -105,8 +105,8 @@ function msg_help
 
 function msg_version
 {
-	pck_name=$(grep '^PACKAGE_NAME' Makefile | awk '{ print $3 }')
-	pck_version=$(grep '^PACKAGE_VERSION' Makefile | awk '{ print $3 }')
+	pck_name=$(grep '^PACKAGE_NAME' Makefile 2>/dev/null | awk '{ print $3 }')
+	pck_version=$(grep '^PACKAGE_VERSION' Makefile 2>/dev/null | awk '{ print $3 }')
 	echo "
  ${pck_name} v ${pck_version}
  Copyright (C) 2010, 2011 Pierre Wieser."



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]