From b1bb554e72d5f5206758e204b678aab0a081db31 Mon Sep 17 00:00:00 2001 From: Esdras Renan Date: Fri, 17 Oct 2025 00:11:36 -0300 Subject: [PATCH] fix: ajustar script web e config tauri --- apps/desktop/src-tauri/tauri.conf.json | 16 ++++++----- scripts/start-web.sh | 39 ++++++++++++++++++++++---- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index c18ead2..cf6b978 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -46,13 +46,15 @@ "icons/Raven.png" ], "windows": { - "webviewInstallMode": "downloadBootstrapper" - }, - "nsis": { - "displayLanguageSelector": false, - "installerIcon": "icons/icon.ico", - "uninstallerIcon": "icons/icon.ico", - "languages": ["pt_BR"] + "webviewInstallMode": { + "type": "downloadBootstrapper", + "silent": true + }, + "nsis": { + "displayLanguageSelector": false, + "installerIcon": "icons/icon.ico", + "languages": ["pt_BR"] + } } } } diff --git a/scripts/start-web.sh b/scripts/start-web.sh index 64f9b34..b5e460c 100644 --- a/scripts/start-web.sh +++ b/scripts/start-web.sh @@ -12,9 +12,30 @@ ensure_pnpm() { return 0 fi + local runtime_home="${HOME:-}" + if [ -z "$runtime_home" ] || [ ! -d "$runtime_home" ] || [ ! -w "$runtime_home" ]; then + runtime_home="$(getent passwd "$(id -u)" | cut -d: -f6 2>/dev/null || true)" + fi + if [ -z "$runtime_home" ] || [ ! -d "$runtime_home" ] || [ ! -w "$runtime_home" ]; then + runtime_home="/tmp" + fi + + local local_bin="${runtime_home}/.local/bin" + local pnpm_prefix="${runtime_home}/.local/share/pnpm" + local corepack_home="${runtime_home}/.local/share/corepack" + + export PATH="${local_bin}:$PATH" + export COREPACK_HOME="${corepack_home}" + + mkdir -p "$local_bin" "$pnpm_prefix" "$corepack_home" >/dev/null 2>&1 || true + + if command -v pnpm >/dev/null 2>&1; then + return 0 + fi + if command -v corepack >/dev/null 2>&1; then - corepack enable >/dev/null 2>&1 || true corepack prepare pnpm@9 --activate >/dev/null 2>&1 || true + corepack enable --install-directory "$local_bin" pnpm >/dev/null 2>&1 || true fi if command -v pnpm >/dev/null 2>&1; then @@ -22,17 +43,25 @@ ensure_pnpm() { fi if command -v npm >/dev/null 2>&1; then - npm install -g pnpm@9 >/dev/null 2>&1 + npm install --prefix "$pnpm_prefix" pnpm@9 >/dev/null 2>&1 || true + if [ -x "${pnpm_prefix}/node_modules/.bin/pnpm" ]; then + ln -sf "${pnpm_prefix}/node_modules/.bin/pnpm" "${local_bin}/pnpm" >/dev/null 2>&1 || true + fi fi - if ! command -v pnpm >/dev/null 2>&1; then - echo "[start-web] pnpm not available; aborting startup" >&2 - exit 1 + if command -v pnpm >/dev/null 2>&1; then + return 0 fi + + echo "[start-web] pnpm not available; aborting startup" >&2 + exit 1 } ensure_pnpm +echo "[start-web] pnpm version: $(pnpm -v 2>/dev/null || echo 'unavailable')" +echo "[start-web] pnpm path: $(command -v pnpm || echo 'not found')" + echo "[start-web] Using APP_DIR=$(pwd)" echo "[start-web] NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:-}" echo "[start-web] NEXT_PUBLIC_CONVEX_URL=${NEXT_PUBLIC_CONVEX_URL:-}"