You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ni...@apache.org on 2004/05/07 18:55:27 UTC
cvs commit: avalon/merlin/cli/src/bin merlinx
niclas 2004/05/07 09:55:27
Modified: merlin/cli/src/bin merlinx
Log:
yet another patch from Cameron Fieber.
Revision Changes Path
1.3 +11 -6 avalon/merlin/cli/src/bin/merlinx
Index: merlinx
===================================================================
RCS file: /home/cvs/avalon/merlin/cli/src/bin/merlinx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- merlinx 6 May 2004 18:56:03 -0000 1.2
+++ merlinx 7 May 2004 16:55:27 -0000 1.3
@@ -8,14 +8,19 @@
# respectively.
#
-#usage VARIABLE=`find_maven_repo "property_file" "property_name" "default_value"`
-function find_property()
+#usage VARIABLE=`find_property "property_file" "property_name" "default_value"`
+find_property()
{
- VAL=${3}
- if [ -f ${1} ] ; then
- VAL=`cat ${1} | grep ^${2} | cut -d= -f2`
+ VAL=
+ if [ -f "${1}" ] ; then
+ VAL=`cat "${1}" | grep "^${2}" | cut -d= -f2`
+ fi
+
+ if [ "${VAL}" = "" ] ; then
+ echo "${3}"
+ else
+ echo "${VAL}"
fi
- echo ${VAL}
}
#
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org