From 60a3f94c9dec544566cd8348ce7dd71ae53fd017 Mon Sep 17 00:00:00 2001 From: skarg Date: Wed, 25 Jul 2007 21:01:24 +0000 Subject: [PATCH] Updated the script to check if ccmtcnvt exists. --- bacnet-stack/comment.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bacnet-stack/comment.sh b/bacnet-stack/comment.sh index 84ee554e..edce137b 100755 --- a/bacnet-stack/comment.sh +++ b/bacnet-stack/comment.sh @@ -1,16 +1,22 @@ #!/bin/sh +# This script converts any C++ comments to C comments +# using the ccmtcnvt tool from the liwc package + +# silent fail if the tool is not installed +[ -x /usr/bin/ccmtcnvt ] || exit 0 + directory=${1-`pwd`} for filename in $( find $directory -name '*.c' ) do echo Converting $filename - ccmtcnvt $filename > /tmp/ccmtcnvt.karg + /usr/bin/ccmtcnvt $filename > /tmp/ccmtcnvt.karg mv /tmp/ccmtcnvt.karg $filename done for filename in $( find $directory -name '*.h' ) do echo Converting $filename - ccmtcnvt $filename > /tmp/ccmtcnvt.karg + /usr/bin/ccmtcnvt $filename > /tmp/ccmtcnvt.karg mv /tmp/ccmtcnvt.karg $filename done