fix mv path

This commit is contained in:
bilulib
2025-07-21 14:45:06 +02:00
parent 2c61e49140
commit aed40090ef
2 changed files with 32 additions and 8 deletions

View File

@ -36,14 +36,26 @@ NODE_VERSION="20" install_node_and_modules
msg_ok "Installed Node.js"
msg_info "Setup ${APPLICATION}"
RELEASE=$(curl -fsSL https://api.github.com/repos/Dictionarry-Hub/profilarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
RELEASE=$(curl -fsSL https://api.github.com/repos/Dictionarry-Hub/profilarr/releases/latest | grep "tag_name" | cut -d'"' -f4)
if [[ -z "$RELEASE" ]]; then
msg_error "Failed to fetch latest release version"
exit 1
fi
temp_file=$(mktemp)
$STD curl -fsSL -o "$temp_file" "https://github.com/Dictionarry-Hub/profilarr/archive/refs/tags/${RELEASE}.zip"
$STD unzip -q "$temp_file" -d /tmp
$STD mkdir -p /opt/${APPLICATION}
$STD mkdir -p /opt/${APPLICATION}_config
$STD mv "/tmp/profilarr-${RELEASE}/backend" /opt/${APPLICATION}/
$STD mv "/tmp/profilarr-${RELEASE}/frontend" /opt/${APPLICATION}/
# Find the actual extracted directory name
EXTRACTED_DIR=$(find /tmp -maxdepth 1 -name "profilarr-*" -type d | head -n1)
if [[ -z "$EXTRACTED_DIR" ]]; then
msg_error "Failed to find extracted directory"
exit 1
fi
$STD mv "${EXTRACTED_DIR}/backend" /opt/${APPLICATION}/
$STD mv "${EXTRACTED_DIR}/frontend" /opt/${APPLICATION}/
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
$STD uv venv /opt/${APPLICATION}/venv
$STD uv pip install --python /opt/${APPLICATION}/venv/bin/python -r /opt/${APPLICATION}/backend/requirements.txt
@ -85,7 +97,7 @@ customize
msg_info "Cleaning up"
rm -f "$temp_file"
rm -rf "/tmp/profilarr-${RELEASE}"
rm -rf "$EXTRACTED_DIR"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"