V.1.0
This commit is contained in:
41
softwares/test/meteorologia_aeroportos/run/run.bat
Normal file
41
softwares/test/meteorologia_aeroportos/run/run.bat
Normal file
@@ -0,0 +1,41 @@
|
||||
@echo off
|
||||
REM ============================================================
|
||||
REM MET Aeroportuário — launcher Windows
|
||||
REM Creates the virtual environment if needed, installs
|
||||
REM dependencies and opens the Streamlit dashboard.
|
||||
REM
|
||||
REM Usage (from any directory):
|
||||
REM run\run.bat
|
||||
REM run\run.bat --server.port 8502
|
||||
REM ============================================================
|
||||
setlocal EnableDelayedExpansion
|
||||
|
||||
REM Resolve the project root (one level above this script's folder)
|
||||
set "PROJ_DIR=%~dp0.."
|
||||
cd /d "%PROJ_DIR%"
|
||||
|
||||
REM ── 1. Virtual environment ────────────────────────────────────
|
||||
if not exist ".venv" (
|
||||
echo [1/3] Criando ambiente virtual...
|
||||
python -m venv .venv
|
||||
if errorlevel 1 (
|
||||
echo [ERRO] Falha ao criar o ambiente virtual.
|
||||
echo Verifique se Python 3.10+ esta instalado e no PATH.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
)
|
||||
|
||||
REM ── 2. Activate and install dependencies ─────────────────────
|
||||
echo [2/3] Instalando dependencias...
|
||||
call .venv\Scripts\activate.bat
|
||||
pip install -q -r env\requirements.txt
|
||||
if errorlevel 1 (
|
||||
echo [ERRO] Falha ao instalar dependencias.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM ── 3. Launch dashboard ───────────────────────────────────────
|
||||
echo [3/3] Iniciando dashboard em http://localhost:8501 ...
|
||||
streamlit run _apps\dashboard.py %*
|
||||
32
softwares/test/meteorologia_aeroportos/run/run.sh
Normal file
32
softwares/test/meteorologia_aeroportos/run/run.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
# ============================================================
|
||||
# MET Aeroportuário — launcher Linux/macOS
|
||||
# Creates a virtual environment if needed, installs
|
||||
# dependencies and launches the Streamlit dashboard.
|
||||
#
|
||||
# Usage (from any directory):
|
||||
# ./run/run.sh
|
||||
# ./run/run.sh --server.port 8502
|
||||
# ============================================================
|
||||
set -euo pipefail
|
||||
|
||||
# Resolve the project root (one level above this script's folder).
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJ_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
cd "$PROJ_DIR"
|
||||
|
||||
# ── 1. Virtual environment ───────────────────────────────────
|
||||
if [ ! -d ".venv" ]; then
|
||||
echo "[1/3] Criando ambiente virtual..."
|
||||
python3 -m venv .venv
|
||||
fi
|
||||
|
||||
# ── 2. Install dependencies ──────────────────────────────────
|
||||
echo "[2/3] Instalando dependencias..."
|
||||
# shellcheck source=/dev/null
|
||||
source .venv/bin/activate
|
||||
pip install -q -r env/requirements.txt
|
||||
|
||||
# ── 3. Launch dashboard ──────────────────────────────────────
|
||||
echo "[3/3] Iniciando dashboard em http://localhost:8501 ..."
|
||||
exec streamlit run _apps/dashboard.py "$@"
|
||||
Reference in New Issue
Block a user