File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11template-suffix : ejs
22dependencies :
33 - extism-py
4+ - uv
45
56available-feature-flags :
67 - name : stub-with-code-samples
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Function to check if a command exists
4+ command_exists () {
5+ command -v " $1 " > /dev/null 2>&1
6+ }
7+
8+ missing_deps=0
9+
10+ # Check for uv
11+ if ! (command_exists uv); then
12+ missing_deps=1
13+ echo " ❌ uv is not installed."
14+ echo " "
15+ echo " To install uv, visit the official download page:"
16+ echo " 👉 https://docs.astral.sh/uv/getting-started/installation/"
17+ echo " "
18+ fi
19+
20+ # Exit with a bad exit code if any dependencies are missing
21+ if [ " $missing_deps " -ne 0 ]; then
22+ echo " Install the missing dependencies and ensure they are on your path. Then run this command again."
23+ # TODO: remove sleep when cli bug is fixed
24+ sleep 2
25+ exit 1
26+ fi
27+
28+ # Check for extism-js
29+ if ! command_exists extism-py; then
30+ echo " ❌ extism-py is not installed."
31+ echo " "
32+ echo " extism-py is needed to compile the plug-in. You can find the instructions to install it here: https://github.com/extism/python-pdk"
33+ echo " "
34+ echo " Alternatively, you can use an install script."
35+ echo " "
36+ echo " 🔹 Mac / Linux:"
37+ echo " curl -L https://raw.githubusercontent.com/extism/python-pdk/main/install.sh | bash"
38+ echo " "
39+ # TODO: remove sleep when cli bug is fixed
40+ sleep 2
41+ exit 1
42+ fi
43+
44+
Original file line number Diff line number Diff line change @@ -14,4 +14,4 @@ build = "PYTHONPATH=./plugin extism-py -o plugin.wasm plugin/__init__.py"
1414format = "uv run ruff format plugin/*.py"
1515
1616# xtp plugin init runs this script before running the format script
17- prepare = "uv sync"
17+ prepare = "bash prepare.sh && uv sync"
You can’t perform that action at this time.
0 commit comments