···1+#!/bin/bash
2+set -e
3+4+# Navigate to the lexicons directory and find all .json files
5+cd ../../lexicons
6+json_files=$(find . -name "*.json" -type f)
7+8+# Go back to the lexicons package directory
9+cd ../packages/lexicons
10+11+# Check if we found any lexicon files
12+if [ -z "$json_files" ]; then
13+ echo "No lexicon files found in ../../lexicons/"
14+ exit 1
15+fi
16+17+# Convert the file list to absolute paths
18+lexicon_paths=""
19+for file in $json_files; do
20+ lexicon_paths="$lexicon_paths ../../lexicons/$file"
21+done
22+23+# Generate lexicons
24+echo "Generating lexicons from: $lexicon_paths"
25+lex gen-server ./src $lexicon_paths --yes