代码拉取完成,页面将自动刷新
同步操作将从 DiDi-opensource/sharingan 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
# To run this shell script to set $GOROOT; First run will wait a few minutes, keep patience!
# `sh install.sh go1.13`
# `export GOROOT=/tmp/recorder-go1.13`
# `export PATH=${GOROOT}/bin:${PATH}`
# set msg
info_msg="\033[;32m[INFO]\033[0m\t"
warn_msg="\033[;33m[WARN]\033[0m\t"
error_msg="\033[;31m[ERROR]\033[0m\t"
# only support amd64
if [ `getconf LONG_BIT` != "64" ] ; then
printf "${warn_msg}-> only support amd64!!!\n"
exit
fi
# nead version param
if [ ! -n "$1" ] ; then
printf "${warn_msg}-> please input version!!!\n"
printf "${info_msg}--> usage: sh install.sh go1.13\n"
exit
fi
# only support go1.10 ~ go1.15
if [ "$1" != "go1.10" ] && [ "$1" != "go1.11" ] && [ "$1" != "go1.12" ] && [ "$1" != "go1.13" ] && [ "$1" != "go1.14" ] && [ "$1" != "go1.15" ]; then
printf "${warn_msg}-> only support go1.10 ~ go1.15!!!\n"
printf "${info_msg}--> usage: sh install.sh go1.13\n"
exit
fi
function install(){
VERSION=$1
# base set
GIT_URL="https://github.com/didi/sharingan-go"
# param
uname=`uname`
uname=`echo $uname | tr '[:upper:]' '[:lower:]'`
file_name=${VERSION}.${uname}-amd64
recorder_dir=/tmp/recorder-${VERSION}
should_update=true
rm -rf ${recorder_dir} && mkdir -p ${recorder_dir}
tmp_file=${recorder_dir}.tar.gz
# download
download_url=${GIT_URL}/releases/download/${VERSION}.recorder/${file_name}.tar.gz
wget ${download_url} -O ${tmp_file}
# tar && set version
tar -xzf ${tmp_file} -C ${recorder_dir} --strip-components=1
# rm
rm -rf ${tmp_file}
}
install $1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。