[IMPROVED] Mover directorios ollama y sounds a carpeta de desarrollo

- Modificar ollama_up.sh para crear carpeta ollama en directorio raíz
- Modificar claude_voice.py para crear carpeta sounds en directorio raíz
- Mejorar la determinación de rutas en ambos scripts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mauro Rosero P. 2025-04-01 17:18:51 -05:00
parent c35f705537
commit b54ea64da5
Signed by: mrosero
GPG key ID: 83BD2A5F674B7E26
2 changed files with 18 additions and 4 deletions

View file

@ -42,7 +42,13 @@ class Colors:
def play_sound(sound_type):
"""Reproduce un sonido para indicar estados"""
sounds_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "sounds")
# Obtener el directorio del script y del proyecto
script_dir = os.path.dirname(os.path.abspath(__file__))
bin_dir = os.path.dirname(script_dir) if script_dir.endswith("/bin") else script_dir
project_dir = os.path.dirname(bin_dir) if bin_dir.endswith("/bin") else os.path.dirname(os.path.abspath(__file__))
# Usar sounds en el directorio del proyecto, no en /bin
sounds_dir = os.path.join(project_dir, "sounds")
if not os.path.exists(sounds_dir):
os.makedirs(sounds_dir, exist_ok=True)

View file

@ -55,8 +55,8 @@ source "${BIN_HOME}/${BIN_BASE}/${BIN_LIBS}/base.lib"
load_messages "${BIN_HOME}/${BIN_BASE}" "${BIN_MESG}" "${BIN_LANG}" "head"
title="${head_000} ${head_002}"
# Change to the directory containing the compose file
cd "${BIN_HOME}/${BIN_BASE}/ollama"
# Create the directory for Ollama in the development directory
mkdir -p "${BIN_HOME}/ollama"
# Check if we should use podman or docker (prefer podman)
if command -v podman >/dev/null 2>&1; then
@ -82,8 +82,16 @@ fi
echo "Using ${COMPOSE_CMD} to start Ollama service..."
# Copy compose file if it doesn't exist in the new location
if [ ! -f "${BIN_HOME}/ollama/podman-compose.yml" ] && [ -f "${BIN_HOME}/${BIN_BASE}/ollama/podman-compose.yml" ]; then
cp "${BIN_HOME}/${BIN_BASE}/ollama/podman-compose.yml" "${BIN_HOME}/ollama/"
fi
# Change to the directory containing the compose file
cd "${BIN_HOME}/ollama"
# Fix relative path in volume mount if needed
if grep -q "../../data:/root/.ollama" "${BIN_HOME}/${BIN_BASE}/ollama/podman-compose.yml"; then
if grep -q "../../data:/root/.ollama" "${BIN_HOME}/ollama/podman-compose.yml"; then
# Create data directory if it doesn't exist
mkdir -p "${BIN_HOME}/data"