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