#!/bin/bash set -e KEY_FILE="$1" if [ -z "$KEY_FILE" ]; then echo "Usage: $0 " exit 1 fi if [ ! -f "$KEY_FILE" ]; then echo "Error: Key file not found: $KEY_FILE" exit 1 fi SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" REPO_ROOT="$(dirname "$SCRIPT_DIR")" cd "$REPO_ROOT" for manifest in plugins/*/manifest.json; do if [ ! -f "$manifest" ]; then continue fi dir=$(dirname "$manifest") name=$(jq -r '.name' "$manifest") version=$(jq -r '.version' "$manifest") plugin_file="$dir/plugin.js" if [ ! -f "$plugin_file" ]; then echo "Warning: $plugin_file not found, skipping" continue fi echo "Signing: $name v$version" signtool sign -key "$KEY_FILE" \ -name "$name" \ -version "$version" \ "$plugin_file" done echo "Done!"