Skip to content

Commit 867cb62

Browse files
committed
Allow LEIN_STABLE to be overridden.
1 parent 1f78137 commit 867cb62

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

bin/release

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@ set -e -u
99

1010
RELEASE_VERSION=$1
1111
CURRENT_VERSION="$RELEASE_VERSION-SNAPSHOT"
12+
LEIN_STABLE=$2
13+
14+
if [ "$LEIN_STABLE" = "" ]; then
15+
LEIN_STABLE=lein-stable
16+
fi
1217

1318
# Would like to use `lein release` here, but we don't have a way to
1419
# update the bash scripts or watch for boot slowdowns that way. Maybe
1520
# try adding lein-shell?
1621

17-
if [ ! -x `which lein-stable` ]; then
18-
echo "Install a stable version of Leiningen as lein-stable."
22+
if [ ! -x `which $LEIN_STABLE` ]; then
23+
echo "Install a stable version of Leiningen as $LEIN_STABLE."
1924
exit 1
2025
fi
2126

@@ -34,7 +39,7 @@ LEIN_ROOT=$PWD
3439

3540
echo "Bootstrapping..."
3641
cd leiningen-core
37-
lein-stable do clean, bootstrap
42+
$LEIN_STABLE do clean, bootstrap
3843
cd ..
3944

4045
echo "Generating uberjar..."
@@ -43,6 +48,7 @@ bin/lein uberjar
4348
RELEASE_JAR=$PWD/target/leiningen-$RELEASE_VERSION-standalone.jar
4449
RELEASE_JAR_CHECKSUM="$(sha256sum $RELEASE_JAR | awk '{ print $1 }')"
4550
SELF_INSTALL_JAR=$HOME/.lein/self-installs/$(basename $RELEASE_JAR)
51+
mkdir -p $HOME/.lein/self-installs
4652
cp $RELEASE_JAR $SELF_INSTALL_JAR
4753

4854
sed -i "s/export LEIN_CHECKSUM=.*/export LEIN_CHECKSUM='$RELEASE_JAR_CHECKSUM'/" bin/lein
@@ -62,7 +68,7 @@ time ../lein-$RELEASE_VERSION run -m clojure.main/main -e nil
6268
time ../lein-$RELEASE_VERSION run -m clojure.main/main -e nil
6369

6470
echo "Check that these are about the same boot times as with the last version."
65-
echo "Run this in a project: time lein-stable run -m clojure.main/main -e nil"
71+
echo "Run this in a project: time $LEIN_STABLE run -m clojure.main/main -e nil"
6672
echo "Proceeding here will publish the new version to the git repo."
6773
echo "Are these acceptable times? (~3s) [Y\n]"
6874
read CONTINUE

0 commit comments

Comments
 (0)