Skip to content

Commit c842473

Browse files
fix: let launch tutorials pass through root .env
1 parent abec38f commit c842473

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

examples/launch-tutorials.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,14 @@ run_tutorial() {
118118
print_colored $GREEN "🚀 Executing: cd .. && uv run agentex agents run --manifest examples/$manifest_path"
119119
print_colored $YELLOW "💡 Press Ctrl+C to stop the tutorial"
120120
echo ""
121-
121+
122122
# Run the tutorial directly (need to go to parent dir where uv project is)
123-
(cd .. && uv run agentex agents run --manifest "examples/$manifest_path")
123+
# Load .env file if it exists and pass variables to the subshell
124+
if [[ -f "../.env" ]]; then
125+
(cd .. && set -a && source .env && set +a && uv run agentex agents run --manifest "examples/$manifest_path")
126+
else
127+
(cd .. && uv run agentex agents run --manifest "examples/$manifest_path")
128+
fi
124129

125130
local exit_code=$?
126131
if [[ $exit_code -eq 0 ]]; then

0 commit comments

Comments
 (0)