Skip to content

Commit 8b6dc8b

Browse files
committed
melting-pot: explicitly check for prerequisites
That way, things won't explode in weird ways.
1 parent e09487d commit 8b6dc8b

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎melting-pot.sh‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
# assumption will not be properly overridden in the melting pot!
6969
#
7070
# Author: Curtis Rueden
71-
# Dependencies: git, mvn, xmllint
7271
# ============================================================================
7372

7473
# -- Functions --
@@ -96,6 +95,19 @@ unknownArg(){
9695
usage=1
9796
}
9897

98+
checkPrereqs(){
99+
while [ $#-gt 0 ]
100+
do
101+
which $1> /dev/null 2> /dev/null
102+
test$? -ne 0 &&echo"Missing prerequisite: $1"&&exit 255
103+
shift
104+
done
105+
}
106+
107+
verifyPrereqs(){
108+
checkPrereqs git mvn xmllint
109+
}
110+
99111
parseArguments(){
100112
while [ $#-gt 0 ]
101113
do
@@ -531,6 +543,7 @@ meltDown(){
531543

532544
# -- Main --
533545

546+
verifyPrereqs
534547
parseArguments $@
535548
createDir "$outputDir"
536549
meltDown "$project"

0 commit comments

Comments
(0)