Skip to content

Commit 9787dc7

Browse files
committed
fix: deploy.sh uses bundled scripts/env_config.py instead of repo-relative $LIB_DIR
All 3 inline Python blocks now use $ENV_CONFIG_DIR which checks: 1. $SKILL_DIR/scripts/env_config.py (bundled copy) 2. $LIB_DIR/env_config.py (repo lib/) Fixes ModuleNotFoundError when installed at ~/.aegis-ai/skills/
1 parent a06f3a6 commit 9787dc7

File tree

1 file changed

+13
-5
lines changed
  • skills/detection/yolo-detection-2026

1 file changed

+13
-5
lines changed

skills/detection/yolo-detection-2026/deploy.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,19 @@ fi
9595

9696
BACKEND="cpu"
9797

98-
if [ -n "$LIB_DIR" ] && [ -f "$LIB_DIR/env_config.py" ]; then
98+
# Find env_config.py — bundled copy or repo lib/
99+
ENV_CONFIG_DIR=""
100+
if [ -f "$SKILL_DIR/scripts/env_config.py" ]; then
101+
ENV_CONFIG_DIR="$SKILL_DIR/scripts"
102+
elif [ -n "$LIB_DIR" ] && [ -f "$LIB_DIR/env_config.py" ]; then
103+
ENV_CONFIG_DIR="$LIB_DIR"
104+
fi
105+
106+
if [ -n "$ENV_CONFIG_DIR" ]; then
99107
log "Detecting hardware via env_config.py..."
100108
DETECT_OUTPUT=$("$VENV_DIR/bin/python" -c "
101109
import sys
102-
sys.path.insert(0, '$LIB_DIR')
110+
sys.path.insert(0, '$ENV_CONFIG_DIR')
103111
from env_config import HardwareEnv
104112
env = HardwareEnv.detect()
105113
print(env.backend)
@@ -121,7 +129,7 @@ print(env.backend)
121129
else
122130
log "env_config.py not found, using heuristic detection..."
123131

124-
# Fallback: inline GPU detection (same as before)
132+
# Fallback: inline GPU detection
125133
if command -v nvidia-smi &>/dev/null; then
126134
cuda_ver=$(nvidia-smi --query-gpu=driver_version --format=csv,noheader 2>/dev/null | head -1)
127135
if [ -n "$cuda_ver" ]; then
@@ -162,7 +170,7 @@ if [ "$BACKEND" != "cpu" ] || [ -f "$SKILL_DIR/requirements_cpu.txt" ]; then
162170

163171
"$VENV_DIR/bin/python" -c "
164172
import sys
165-
sys.path.insert(0, '$LIB_DIR')
173+
sys.path.insert(0, '$ENV_CONFIG_DIR')
166174
from env_config import HardwareEnv
167175
env = HardwareEnv.detect()
168176
@@ -191,7 +199,7 @@ fi
191199
log "Verifying installation..."
192200
"$VENV_DIR/bin/python" -c "
193201
import sys
194-
sys.path.insert(0, '$LIB_DIR')
202+
sys.path.insert(0, '$ENV_CONFIG_DIR')
195203
from env_config import HardwareEnv
196204
import json
197205

0 commit comments

Comments
 (0)