Updated the script to check if ccmtcnvt exists.
This commit is contained in:
@@ -1,16 +1,22 @@
|
|||||||
#!/bin/sh
|
#!/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`}
|
directory=${1-`pwd`}
|
||||||
for filename in $( find $directory -name '*.c' )
|
for filename in $( find $directory -name '*.c' )
|
||||||
do
|
do
|
||||||
echo Converting $filename
|
echo Converting $filename
|
||||||
ccmtcnvt $filename > /tmp/ccmtcnvt.karg
|
/usr/bin/ccmtcnvt $filename > /tmp/ccmtcnvt.karg
|
||||||
mv /tmp/ccmtcnvt.karg $filename
|
mv /tmp/ccmtcnvt.karg $filename
|
||||||
done
|
done
|
||||||
|
|
||||||
for filename in $( find $directory -name '*.h' )
|
for filename in $( find $directory -name '*.h' )
|
||||||
do
|
do
|
||||||
echo Converting $filename
|
echo Converting $filename
|
||||||
ccmtcnvt $filename > /tmp/ccmtcnvt.karg
|
/usr/bin/ccmtcnvt $filename > /tmp/ccmtcnvt.karg
|
||||||
mv /tmp/ccmtcnvt.karg $filename
|
mv /tmp/ccmtcnvt.karg $filename
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user