代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
export MILE1_HOME="$HOME/.mile1"
export MILE1_JAR="$MILE1_HOME/mile1.jar"
export MILE1_JAR_URL="http://git.oschina.net/43284683/Mile1/raw/master/downloads/mile1.jar"
# check $MILE1_JAR , if not exists , download from $MILE1_JAR_URL
# all other features delegated to clojure code
# sbt jar and sbt launch script will be installed at the same directory of this script
export JAVA_CMD="${JAVA_CMD:="java"}"
if type -p curl > /dev/null 2>&1; then
# if ["$http_proxy" != ""]; then
# CURL_PROXY="-x $http_proxy"
# fi
# HTTP_CLIENT="curl $CURL_PROXY -f -L -o"
HTTP_CLIENT="curl -f -L -o"
else
HTTP_CLIENT="wget -O"
fi
function download_mile1 {
mkdir -p "$(dirname $MILE1_JAR)"
$HTTP_CLIENT "$MILE1_JAR.pending" "$MILE1_JAR_URL"
if [ $? == 0 ]; then
mv -f "$MILE1_JAR.pending" "$MILE1_JAR"
else
rm "$MILE1_JAR.pending" 2>/dev/null
echo "Failed to download $MILE1_JAR_URL"
exit 1
fi
}
if [[ -r $MILE1_JAR ]]; then
if [ $1 = "upgrade" ]; then
rm $MILE1_JAR
download_mile1
echo "Mile1 upgraded"
exit 0
else
$JAVA_CMD -Dmile1.script.path="$(dirname $0)" -jar $MILE1_JAR "$@"
fi
else
echo "Installing Mile1 ..."
download_mile1
echo "Mile1 installed."
if [ $1 != "upgrade" ]; then
$JAVA_CMD -Dmile1.script.path="$(dirname $0)" -jar $MILE1_JAR "$@"
exit 0
fi
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。