-
Notifications
You must be signed in to change notification settings - Fork 2
/
jb
executable file
·47 lines (32 loc) · 1.16 KB
/
jb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /usr/bin/env bash
mkdir -p ${HOME}/.jbake
if [ -z "${JBAKE_VERSION}" ]
then
JBAKE_VERSION=2.6.4
fi
DOWNLOAD_BASE_DIR=/tmp
JBAKE_HOME=${HOME}/.jbake
JBAKE_DIST_NAME=jbake-${JBAKE_VERSION}-bin.zip
JBAKE_CORE_JAR=${JBAKE_HOME}/jbake-${JBAKE_VERSION}-bin/lib/jbake-core-${JBAKE_VERSION}.jar
if [ ! -r $JBAKE_CORE_JAR ]
then
DOWNLOAD_URL="https://dl.bintray.com/jbake/binary/${JBAKE_DIST_NAME}"
echo "Downloading JBake ${JBAKE_VERSION} from ${DOWNLOAD_URL} to ${DOWNLOAD_BASE_DIR}"
(cd ${DOWNLOAD_BASE_DIR} ; curl -v --location -O ${DOWNLOAD_URL})
if [ -r ${DOWNLOAD_BASE_DIR}/${JBAKE_DIST_NAME} ]
then
(cd ${DOWNLOAD_BASE_DIR} ; unzip ${JBAKE_DIST_NAME} )
(cd ${DOWNLOAD_BASE_DIR} ; mv -v jbake-${JBAKE_VERSION}-bin ${JBAKE_HOME}/ )
fi
if [ ! -r ${JBAKE_CORE_JAR} ]
then
echo "Unable to download JBake ${JBAKE_VERSION} properly."
exit 1;
fi
fi
for i in $(seq 1 75); do echo -n "-"; done; echo
echo "Running ${JBAKE_VERSION}"
echo "Running from ${JBAKE_HOME}/jbake-${JBAKE_VERSION}"
# When will I have a Bash 4 under OS X?
for i in $(seq 1 75); do echo -n "-"; done; echo
${JBAKE_HOME}/jbake-${JBAKE_VERSION}-bin/bin/jbake ${@}