1 Star 1 Fork 1

老猪/Mile1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mile1 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
#!/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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Clojure
1
https://gitee.com/43284683/Mile1.git
git@gitee.com:43284683/Mile1.git
43284683
Mile1
Mile1
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385