File tree Expand file tree Collapse file tree 1 file changed +41
-1
lines changed
Expand file tree Collapse file tree 1 file changed +41
-1
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ # Navigate to agentic directory (script's parent directory)
4+ cd " $( dirname " $0 " ) /.." || exit 1
5+
6+ # Track if we created the venv
7+ CREATED_VENV=false
8+
9+ # Cleanup function
10+ cleanup () {
11+ echo " "
12+ echo " Cleaning up..."
13+ if [ " $CREATED_VENV " = true ] && [ -d " venv" ]; then
14+ echo " Removing virtual environment..."
15+ rm -rf venv
16+ fi
17+ echo " Done."
18+ exit 0
19+ }
20+
21+ # Trap signals to run cleanup on exit
22+ trap cleanup SIGINT SIGTERM EXIT
23+
24+ # Setup pyenv if available
325export PYENV_ROOT=" $HOME /.pyenv"
426[[ -d $PYENV_ROOT /bin ]] && export PATH=" $PYENV_ROOT /bin:$PATH "
5- eval " $( pyenv init -) "
27+ if command -v pyenv & > /dev/null; then
28+ eval " $( pyenv init -) "
29+ fi
630
31+ # Create virtual environment if it doesn't exist
32+ if [ ! -d " venv" ]; then
33+ echo " Creating virtual environment..."
34+ python -m venv venv
35+ CREATED_VENV=true
36+ fi
37+
38+ # Activate virtual environment
739source venv/bin/activate
40+
41+ # Install dependencies if not already installed
42+ if ! python -c " import fastapi" & > /dev/null; then
43+ echo " Installing dependencies..."
44+ pip install -r requirements.txt
45+ fi
46+
47+ # Run the agent
848python agent.py
You can’t perform that action at this time.
0 commit comments