Skip to content

Commit c834f8e

Browse files
committed
use similar path, reduce checks
1 parent a1d4923 commit c834f8e

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
# If the user didn't specify a coatjava version, try auto-detect the version:
99100
if [ -z ${coatjava+x} ]
@@ -109,12 +110,11 @@ then
109110
echo -e "\nUsing local COATJAVA installation:\n\t$coatjava"
110111
elif ! [[ "$coatjava" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)t?$ ]] # must be semver, or semver+"t"
111112
then
112-
echo -e "\n\nWARNING: COATJAVA doesn't look like a local installation nor version number: $coatjava"
113+
echo -e "\nWARNING: COATJAVA doesn't look like a local installation nor version number: $coatjava"
113114
fi
114115

115116
# Do everything inside a new, temporary directory:
116-
[ -w "." ] || error "Current working directory is not writeable: \$PWD=$PWD"
117-
tmp_dir=$(mktemp -d tmp.install-clara.XXXXXX)
117+
tmp_dir=$(mktemp -d $clara_home.tmp.XXXXXX)
118118
[ $? -ne 0 ] && error "Cannot create temporary directory: $tmp_dir"
119119
tmp_dir=$(cd $tmp_dir && pwd)
120120
echo -e "\nCreating temporary build directory:\n\t$tmp_dir"
@@ -133,15 +133,15 @@ fi
133133
# COATJAVA:
134134
if ! compgen -G "$coatjava/lib/clas/coat-libs-*.jar" > /dev/null
135135
then
136-
echo -e "\nRetrieving COATJAVA version $coatjava ..."
136+
echo -e "\nRetrieving COATJAVA/$coatjava ..."
137137
get https://clasweb.jlab.org/clas12offline/distribution/coatjava/coatjava-$coatjava.tar.gz
138138
coatjava=./coatjava
139139
fi
140140
mkdir -p clara-cre/plugins/clas12/config
141141
cp -Lr $coatjava/etc $coatjava/bin $coatjava/lib* clara-cre/plugins/clas12
142142

143143
# GRAPES:
144-
echo -e "\nRetrieving GRAPES version $grapes ..."
144+
echo -e "\nRetrieving GRAPES/$grapes ..."
145145
get https://clasweb.jlab.org/clas12offline/distribution/grapes/grapes-$grapes.tar.gz
146146
mv grapes-$grapes clara-cre/plugins/grapes
147147

0 commit comments

Comments
 (0)