You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: infra/scripts/post-provision/post_deploy.sh
+29-39Lines changed: 29 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -231,7 +231,7 @@ get_value_from_deployment() {
231
231
local primary_key="$2"
232
232
local fallback_key="$3"
233
233
234
-
python3 - <<PY
234
+
"${python_cmd:-python3}" - <<PY
235
235
import json
236
236
import sys
237
237
outputs = json.load(sys.stdin)
@@ -388,10 +388,10 @@ deploy_content_pack() {
388
388
return 0
389
389
fi
390
390
391
-
info " Deploying data for content pack: $(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["name"])'"$pack_json_path")"
391
+
info " Deploying data for content pack: $("${python_cmd:-python3}" -c 'import json,sys; print(json.load(open(sys.argv[1]))["name"])'"$pack_json_path")"
fatal "Python not found or not runnable. Install Python 3.10+ and add it to PATH (and disable Windows App Execution Aliases for python/python3 if on Windows)."
568
575
fi
569
576
570
577
if [ !-d"$venv_path" ];then
@@ -574,9 +581,21 @@ activate_python_env() {
574
581
info "Virtual environment already exists. Skipping creation."
575
582
fi
576
583
584
+
# Activate the venv (Linux/macOS use bin/, Windows uses Scripts/)
577
585
if [ -f"$venv_path/bin/activate" ];then
578
586
# shellcheck disable=SC1091
579
587
."$venv_path/bin/activate"
588
+
elif [ -f"$venv_path/Scripts/activate" ];then
589
+
# shellcheck disable=SC1091
590
+
."$venv_path/Scripts/activate"
591
+
fi
592
+
593
+
# Pin python_cmd to the venv interpreter so subsequent calls don't accidentally
594
+
# hit the Microsoft Store alias on Windows.
595
+
if [ -x"$venv_path/bin/python" ];then
596
+
python_cmd="$venv_path/bin/python"
597
+
elif [ -x"$venv_path/Scripts/python.exe" ];then
598
+
python_cmd="$venv_path/Scripts/python.exe"
580
599
fi
581
600
582
601
info "Installing Python dependencies..."
@@ -831,33 +850,4 @@ main() {
831
850
echo""
832
851
fi
833
852
}
834
-
835
-
main "$@"uccessfully."
836
-
fi
837
-
fi
838
-
fi
839
-
840
-
echo ""
841
-
if [ "$has_errors" = true ]; then
842
-
echo "========================================"
843
-
echo " Post-deployment seeding completed with ERRORS"
0 commit comments