Skip to content

Commit 16f0019

Browse files
committed
use similar path, reduce checks
1 parent 7be30bb commit 16f0019

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

install-clara

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,14 @@ do
8787
esac
8888
done
8989

90-
# Check requested installation path:
90+
# Check installation path:
9191
clara_home="$args"
92-
[ "${#args[@]}" -lt 1 ] && error "Missing PATH argument"
92+
[ "${#args[@]}" -lt 1 ] && error "Missing PATH argument."
9393
[ "${#args[@]}" -gt 1 ] && error "Extra PATH arguments: ${args[@]:1}"
9494
[ -e "$clara_home" ] && error "Installation PATH already exists: $clara_home"
9595
mkdir -p $clara_home || error "Cannot create installation PATH: $clara_home"
9696
clara_home=$(cd $clara_home && pwd) && rmdir $clara_home
97+
echo -e "\nConfigured for a CLARA_HOME installation at:\n\t$clara_home"
9798

9899
# Detect local COATJAVA installation and convert into an absolute path:
99100
if compgen -G "$coatjava/lib/clas/coat-libs-*.jar" > /dev/null
@@ -102,12 +103,11 @@ then
102103
echo -e "\nUsing local COATJAVA installation:\n\t$coatjava"
103104
elif ! [[ "$coatjava" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)t?$ ]] # must be semver, or semver+"t"
104105
then
105-
echo -e "\n\nWARNING: COATJAVA doesn't look like a local installation nor version number: $coatjava"
106+
echo -e "\nWARNING: COATJAVA doesn't look like a local installation nor version number: $coatjava"
106107
fi
107108

108109
# Do everything inside a new, temporary directory:
109-
[ -w "." ] || error "Current working directory is not writeable: \$PWD=$PWD"
110-
tmp_dir=$(mktemp -d tmp.install-clara.XXXXXX)
110+
tmp_dir=$(mktemp -d $clara_home.tmp.XXXXXX)
111111
[ $? -ne 0 ] && error "Cannot create temporary directory: $tmp_dir"
112112
tmp_dir=$(cd $tmp_dir && pwd)
113113
echo -e "\nCreating temporary build directory:\n\t$tmp_dir"
@@ -126,15 +126,15 @@ fi
126126
# COATJAVA:
127127
if ! compgen -G "$coatjava/lib/clas/coat-libs-*.jar" > /dev/null
128128
then
129-
echo -e "\nRetrieving COATJAVA version $coatjava ..."
129+
echo -e "\nRetrieving COATJAVA/$coatjava ..."
130130
get https://clasweb.jlab.org/clas12offline/distribution/coatjava/coatjava-$coatjava.tar.gz
131131
coatjava=./coatjava
132132
fi
133133
mkdir -p clara-cre/plugins/clas12/config
134134
cp -Lr $coatjava/etc $coatjava/bin $coatjava/lib* clara-cre/plugins/clas12
135135

136136
# GRAPES:
137-
echo -e "\nRetrieving GRAPES version $grapes ..."
137+
echo -e "\nRetrieving GRAPES/$grapes ..."
138138
get https://clasweb.jlab.org/clas12offline/distribution/grapes/grapes-$grapes.tar.gz
139139
mv grapes-$grapes clara-cre/plugins/grapes
140140

0 commit comments

Comments
 (0)