Download bt-source/panel/mod/base/git_tool/install.sh from SZFSPC/apple: direct link, hf CLI and curl.
- Browser
- Download file 565 Bytes
-
https://huggingface.co/spaces/SZFSPC/apple/resolve/main/bt-source/panel/mod/base/git_tool/install.sh
- Command line
-
hf download hf://spaces/SZFSPC/apple/bt-source/panel/mod/base/git_tool/install.sh
-
curl -L -o install.sh https://huggingface.co/spaces/SZFSPC/apple/resolve/main/bt-source/panel/mod/base/git_tool/install.sh
565 Bytes
| if command -v apt-get &> /dev/null; then | |
| package_manager="apt-get" | |
| elif command -v yum &> /dev/null; then | |
| package_manager="yum" | |
| else | |
| echo "Git installation failed." | |
| exit 1 | |
| fi | |
| # 安装Git | |
| if [ "$package_manager" = "apt-get" ]; then | |
| apt-get update | |
| apt-get install git -y | |
| elif [ "$package_manager" = "yum" ]; then | |
| yum install git -y | |
| fi | |
| # 验证Git安装 | |
| git_version=$(git --version) | |
| # shellcheck disable=SC2181 | |
| if [ $? -eq 0 ]; then | |
| echo "Git installed successfully. Version: $git_version" | |
| else | |
| echo "Git installation failed." | |
| fi |