From b54ea64da5110092478c70c9005361b1350b519a Mon Sep 17 00:00:00 2001 From: "Mauro Rosero P." Date: Tue, 1 Apr 2025 17:18:51 -0500 Subject: [PATCH] [IMPROVED] Mover directorios ollama y sounds a carpeta de desarrollo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- bin/claude_voice.py | 8 +++++++- bin/ollama_up.sh | 14 +++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/bin/claude_voice.py b/bin/claude_voice.py index 60a6801..d06f6a4 100755 --- a/bin/claude_voice.py +++ b/bin/claude_voice.py @@ -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) diff --git a/bin/ollama_up.sh b/bin/ollama_up.sh index 8e8c6d5..2e49e84 100755 --- a/bin/ollama_up.sh +++ b/bin/ollama_up.sh @@ -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"