|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +PYTHON_PLUGINS=() |
| 4 | +LUA_PLUGINS=() |
| 5 | + |
| 6 | +while IFS= read -r line; do |
| 7 | + submodule_path=$(echo "$line" | awk '{print $2}') |
| 8 | + |
| 9 | + if [[ -z "$submodule_path" ]]; then |
| 10 | + continue |
| 11 | + fi |
| 12 | + |
| 13 | + plugin_json="$submodule_path/plugin.json" |
| 14 | + plugin_name=$(basename "$submodule_path") |
| 15 | + |
| 16 | + if [[ -f "$plugin_json" ]]; then |
| 17 | + backend_type=$(jq -r '.backendType // "undefined"' "$plugin_json" 2>/dev/null) |
| 18 | + use_backend=$(jq -r 'if has("useBackend") then .useBackend else true end' "$plugin_json" 2>/dev/null) |
| 19 | + |
| 20 | + if [[ "$use_backend" == "false" || "$backend_type" == "lua" ]]; then |
| 21 | + LUA_PLUGINS+=("$plugin_name") |
| 22 | + else |
| 23 | + PYTHON_PLUGINS+=("$plugin_name") |
| 24 | + fi |
| 25 | + else |
| 26 | + echo "Warning: No plugin.json found in $submodule_path" |
| 27 | + fi |
| 28 | +done < <(git submodule status) |
| 29 | + |
| 30 | +TOTAL_PLUGINS=$(( ${#LUA_PLUGINS[@]} + ${#PYTHON_PLUGINS[@]} )) |
| 31 | + |
| 32 | +echo "## Repository Manifest" |
| 33 | +echo "" |
| 34 | + |
| 35 | +# Determine the max rows needed |
| 36 | +max_rows=${#LUA_PLUGINS[@]} |
| 37 | +if (( ${#PYTHON_PLUGINS[@]} > max_rows )); then |
| 38 | + max_rows=${#PYTHON_PLUGINS[@]} |
| 39 | +fi |
| 40 | + |
| 41 | +echo "The following table describes the remaining deprecated Python plugins that need to be ported to Lua." |
| 42 | +echo "Python is no longer officially supported by Millennium and will be removed entirely in a future update." |
| 43 | + |
| 44 | +echo "" |
| 45 | +echo "**Total**: ${TOTAL_PLUGINS}" |
| 46 | +echo " * **Lua**: ${#LUA_PLUGINS[@]}" |
| 47 | +echo " * **Python**: ${#PYTHON_PLUGINS[@]}" |
| 48 | +echo "" |
| 49 | +echo "" |
| 50 | + |
| 51 | +echo "| Lua | Python |" |
| 52 | +echo "|-----|--------|" |
| 53 | + |
| 54 | +for (( i=0; i<max_rows; i++ )); do |
| 55 | + if (( i < ${#LUA_PLUGINS[@]} )); then |
| 56 | + lua_num="$(( i + 1 ))" |
| 57 | + lua_name="${LUA_PLUGINS[$i]}" |
| 58 | + else |
| 59 | + lua_num="" |
| 60 | + lua_name="" |
| 61 | + fi |
| 62 | + |
| 63 | + if (( i < ${#PYTHON_PLUGINS[@]} )); then |
| 64 | + py_num="$(( i + 1 ))" |
| 65 | + py_name="${PYTHON_PLUGINS[$i]}" |
| 66 | + else |
| 67 | + py_num="" |
| 68 | + py_name="" |
| 69 | + fi |
| 70 | + |
| 71 | + echo "| $lua_name | $py_name |" |
| 72 | +done |
0 commit comments