This commit is contained in:
@@ -7,18 +7,29 @@ set -e
|
||||
# This script creates two files:
|
||||
# src/utils/createagent.hpp
|
||||
# src/utils/createagent.cpp
|
||||
#
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# check if dehydrate is installed
|
||||
if ! command -v dehydrate &> /dev/null; then
|
||||
echo "dehydrate could not be found - installing"
|
||||
curl -fsSL https://gitea.jde.nz/public/dehydrate/releases/download/latest/install.sh | bash
|
||||
else
|
||||
# ensure we have latest dehydrate.
|
||||
dehydrate -u
|
||||
fi
|
||||
|
||||
# Create temporary directory for dehydrate
|
||||
TEMP_DIR=$(mktemp -d)
|
||||
echo "Using temporary directory: ${TEMP_DIR}"
|
||||
|
||||
# Get current architecture
|
||||
ARCH=$(uname -m)
|
||||
|
||||
# Download dehydrate for current architecture
|
||||
echo "Downloading dehydrate for architecture: ${ARCH}"
|
||||
curl -fsSL "http://getbin.xyz/dehydrate:latest-${ARCH}" -o "${TEMP_DIR}/dehydrate"
|
||||
chmod +x "${TEMP_DIR}/dehydrate"
|
||||
|
||||
# Ensure autogen directory exists
|
||||
mkdir -p "${SCRIPT_DIR}/src/autogen"
|
||||
dehydrate "${SCRIPT_DIR}/agent-remote" "${SCRIPT_DIR}/src/autogen"
|
||||
dehydrate "${SCRIPT_DIR}/agent-local" "${SCRIPT_DIR}/src/autogen"
|
||||
|
||||
# Run dehydrate from temp location
|
||||
echo "Running dehydrate from temporary location"
|
||||
"${TEMP_DIR}/dehydrate" "${SCRIPT_DIR}/agent-remote" "${SCRIPT_DIR}/src/autogen"
|
||||
"${TEMP_DIR}/dehydrate" "${SCRIPT_DIR}/agent-local" "${SCRIPT_DIR}/src/autogen"
|
||||
|
||||
# Clean up temporary directory
|
||||
echo "Cleaning up temporary directory: ${TEMP_DIR}"
|
||||
rm -rf "${TEMP_DIR}"
|
||||
|
Reference in New Issue
Block a user