代码拉取完成,页面将自动刷新
同步操作将从 GiteeStudio/git-dist 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env bash
# Fetch install: https://cmake.org/files/v3.11/cmake-3.11.1-Linux-x86_64.tar.gz
function download() {
local url="${1}"
local path="${2}"
curl -f --progress-bar -L --output "${path}" "${url}"
}
readonly CMAKE_REMOTE_VERSION="https://gitee.com/oscstudio/git-dist/raw/master/version"
Xdirname=$(dirname "$0")
PrefixDir=$(
cd "$Xdirname"
pwd
) || exit 1
if [[ -f "${PrefixDir}/version" ]]; then
# shellcheck source=/dev/null
source "${PrefixDir}/version"
else
echo "fetch remote version"
curl -f --progress-bar -L --output /tmp/cmake-version "$CMAKE_REMOTE_VERSION"
if [[ ! -f "/tmp/cmake-version" ]]; then
echo -e "\\x1b[31munable download cmake version file\\x1b[0m"
exit 1
fi
# shellcheck source=/dev/null
source "/tmp/cmake-version"
fi
echo "download cmake: $CMAKE_VERSION.$CMAKE_PATCH"
CMAKE_BASENAME="cmake-${CMAKE_VERSION}.${CMAKE_PATCH}-Linux-x86_64"
CMAKE_NAME="${CMAKE_BASENAME}.tar.gz"
# https://github.com/Kitware/CMake/releases/download/v3.13.0/cmake-3.13.0-Linux-x86_64.tar.gz
CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}.${CMAKE_PATCH}/${CMAKE_NAME}"
CMAKE_DOWNLOAD="/tmp/${CMAKE_NAME}"
download "${CMAKE_URL}" "${CMAKE_DOWNLOAD}"
cd /tmp || exit 1
tar -xvf "$CMAKE_NAME"
if [[ -d "/usr/local/cmake" ]]; then
#statements
rm "/usr/local/cmake" -rf
else
mkdir -p "/usr/local"
fi
mv "/tmp/${CMAKE_BASENAME}" "/usr/local/cmake"
sudo ln -s -f "/usr/local/cmake/bin/cmake" "/usr/local/bin"
sudo ln -s -f "/usr/local/cmake/bin/ccmake" "/usr/local/bin"
sudo ln -s -f "/usr/local/cmake/bin/cpack" "/usr/local/bin"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。