jexp/store-utils

warn when maven not installed

Dcanzano opened this issue · 1 comments

line 44-56 report

MAVEN=`which mvn`
JARFILE=`echo store-util-*.jar`

if [[ -d "$NEO4J_HOME" && -f "$JARFILE" ]]; then
   java $MAVEN_OPTS -Ddbms.pagecache.memory=$CACHE -Ddbms.pagecache.memory.source=$CACHE_SRC -classpath "$NEO4J_HOME/lib/*":$JARFILE org.neo4j.tool.StoreCopy \
   $SRC $DST $SKIP_RELS $SKIP_PROPS $SKIP_LABELS $DELETE_NODES $KEEP_NODE_IDS
else
   if [[ ! -f $MAVEN ]]; then 
      echo "Apache Maven not installed"
   else
      $MAVEN clean compile exec:java -P${EDITION} -e -Dexec.mainClass="org.neo4j.tool.StoreCopy" -Ddbms.pagecache.memory=$CACHE -Ddbms.pagecache.memory.source=$CACHE_SRC \
         -Dexec.args="$SRC $DST $SKIP_RELS $SKIP_PROPS $SKIP_LABELS $DELETE_NODES $KEEP_NODE_IDS"
   fi

which does check for the existence of Maven by way if

else
   if [[ ! -f $MAVEN ]]; then 
      echo "Apache Maven not installed"

but that check is from the results of a IF ... THEN ... ELSE. and only executed if ELSE.

Can we not issue the check for maven existence above and before the IF ... THEN ... ELSE

created in error.. disregard