代码拉取完成,页面将自动刷新
同步操作将从 src-oepkgs/tensorrt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
# 校验入口脚本参数
function check_build_param() {
if [[ $# -ne 0 && "$1" ]]; then
echo "Execute the following command to install:"
echo "bash /path/to/build.sh"
exit 1
fi
}
# 打印当前运行脚本信息
function print_current_running_script_info() {
exec_path=$(get_current_dir)
echo "# ------------------------------------------------------------------------"
echo "# ${exec_path}/$1 正在运行"
}
#检查入参个数和路径格式
function is_check_build_install_directory() {
if [[ $# -ne 3 ]]; then
echo "The format is as follows:"
echo "bash $3 buildpath installpath"
echo ":param buildpath: 应用构建绝对路径"
echo ":param installpath: 应用安装绝对路径"
exit 1
fi
[[ ! "$1" =~ ^/.* || "$1" = "/" ]] && echo "请输入正确的构建路径" && exit 1
[[ ! "$2" =~ ^/.* || "$2" = "/" ]] && echo "请输入正确的安装路径" && exit 1
echo "# ------------------------------------------------------------------------"
echo "# $3 正在运行"
}
# 校验构建路径与安装路径是否为同一路径
function is_equal_build_install_path() {
local buildpath
local installpath
buildpath="$1"
installpath="$2"
[[ "${buildpath}" =~ .*/$ ]] && buildpath=${buildpath%/*}
[[ "${installpath}" =~ .*/$ ]] && installpath=${installpath%/*}
[[ "${buildpath}" == "${installpath}" ]] && echo "构建路径与安装路径需为不同路径" && exit 1
echo "# 构建路径为$1"
echo "# 安装路径为$2"
}
# 创建文件夹
function create_dir() {
# local path
# path="$1"
# [[ "$path" =~ .*/$ ]] && path=${path%/*}
# if [[ ! -d "${path}" && ! -f "${path}" ]]; then
# mkdir -p "${path}"
# elif [[ -n "$(ls -A "$1")" ]]; then
# path=$path$(date "+%y%m%d%H%M%S") && mkdir -p "${path}"
# fi
# echo "${path}"
local path
base_path="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
path=${base_path}/"$1"
[[ "$path" =~ .*/$ ]] && path=${path%/*}
if [[ ! -f "${path}" ]]; then
rm -rf "${path}"
mkdir -p "${path}"
fi
echo "${path}"
}
# 获取当前文件夹路径
function get_current_dir() {
local current_dir
current_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
echo "${current_dir}"
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。