修改离线部署脚本的路径

This commit is contained in:
Tian jianyong 2024-12-19 17:25:34 +08:00
parent fe4e25193a
commit 5de3e946ae

View File

@ -25,10 +25,21 @@ if [ ! -f /etc/centos-release ]; then
exit 1
fi
# Get the absolute path of the project root directory
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# Get script directory and project root
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "${SCRIPT_DIR}")"
PROJECT_NAME="$(basename "${PROJECT_ROOT}")"
# Check if running from the correct directory
if [ ! -f "${PROJECT_ROOT}/CMakeLists.txt" ] || \
[ ! -d "${PROJECT_ROOT}/src" ] || \
[ ! -d "${PROJECT_ROOT}/scripts" ]; then
log_error "This script must be run from the project root directory (CollisionAvoidance)"
log_error "Current directory: $(pwd)"
log_error "Please run: cd /path/to/CollisionAvoidance && ./scripts/prepare_offline_packages.sh"
exit 1
fi
# Create packages directory
PACKAGES_DIR="${PROJECT_ROOT}/packages"
log_info "Creating packages directory: ${PACKAGES_DIR}"