From 4268c05a9fc51b4d55e73f447c1946ffca882c46 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Fri, 21 Mar 2025 09:36:13 +0100 Subject: [PATCH] fixes --- install/meilisearch-install.sh | 2 +- misc/api.func | 189 ++++++++++++++++----------------- 2 files changed, 95 insertions(+), 96 deletions(-) diff --git a/install/meilisearch-install.sh b/install/meilisearch-install.sh index 0a10db13..4fdafd15 100644 --- a/install/meilisearch-install.sh +++ b/install/meilisearch-install.sh @@ -65,7 +65,7 @@ if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then mv "$tmp_dir"/*/* /opt/meilisearch-ui/ cd /opt/meilisearch-ui sed -i 's|const hash = execSync("git rev-parse HEAD").toString().trim();|const hash = "unknown";|' /opt/meilisearch-ui/vite.config.ts - pnpm install + $STD pnpm install cat < /opt/meilisearch-ui/.env.local VITE_SINGLETON_MODE=true VITE_SINGLETON_HOST=http://${LOCAL_IP}:7700 diff --git a/misc/api.func b/misc/api.func index 44b17ab0..eacfeb25 100644 --- a/misc/api.func +++ b/misc/api.func @@ -4,24 +4,25 @@ post_to_api() { - echo -e "Posting to API..." - if ! command -v curl &> /dev/null; then - return - fi + echo -e "Posting to API..." + if ! command -v curl &>/dev/null; then + return + fi - if [ "$DIAGNOSTICS" = "no" ]; then - return - fi + if [ "$DIAGNOSTICS" = "no" ]; then + return + fi - if [ -z "$RANDOM_UUID" ]; then - return - fi + if [ -z "$RANDOM_UUID" ]; then + return + fi - local API_URL="http://api.community-scripts.org/dev/upload" - local pve_version="not found" - pve_version=$(pveversion | awk -F'[/ ]' '{print $2}') + local API_URL="http://api.community-scripts.org/dev/upload" + local pve_version="not found" + pve_version=$(pveversion | awk -F'[/ ]' '{print $2}') - JSON_PAYLOAD=$(cat < /dev/null; then - return + if ! command -v curl &>/dev/null; then + return fi if [ "$POST_UPDATE_DONE" = true ]; then @@ -162,26 +162,25 @@ post_update_to_api() { local exit_code="${2:-0}" fi - local API_URL="http://api.community-scripts.org/dev/upload/updatestatus" error=$(get_error_description "$exit_code") - if [ -z "$error" ]; then error="Unknown error" fi - JSON_PAYLOAD=$(cat <