mirror of
https://github.com/cubixle/radius-rs.git
synced 2026-04-25 00:34:48 +01:00
Accept multiple dict files at code-generator
This commit is contained in:
@@ -7,6 +7,7 @@ DICTS_DIR="${REPO_ROOT}/dicts"
|
||||
SRC_DIR="${REPO_ROOT}/radius/src"
|
||||
|
||||
DICTS=$(ls "$DICTS_DIR")
|
||||
DICT_FILES=()
|
||||
|
||||
# shellcheck disable=SC2068
|
||||
for DICT in ${DICTS[@]}; do
|
||||
@@ -14,17 +15,12 @@ for DICT in ${DICTS[@]}; do
|
||||
DICT_FILE="${DICTS_DIR}/dictionary.${DICT_NAME}"
|
||||
if [ -f "$DICT_FILE" ]; then
|
||||
cat /dev/null > "${SRC_DIR}/${DICT_NAME}.rs"
|
||||
DICT_FILES+=("$DICT_FILE")
|
||||
fi
|
||||
done
|
||||
|
||||
# shellcheck disable=SC2068
|
||||
for DICT in ${DICTS[@]}; do
|
||||
DICT_NAME="${DICT##*.}"
|
||||
DICT_FILE="${DICTS_DIR}/dictionary.${DICT_NAME}"
|
||||
if [ -f "$DICT_FILE" ]; then
|
||||
cargo run --bin code-generator "$DICT_FILE" "${SRC_DIR}/${DICT_NAME}.rs"
|
||||
fi
|
||||
done
|
||||
cargo run --bin code-generator -- --out-dir="${SRC_DIR}/" ${DICT_FILES[@]}
|
||||
|
||||
cargo fix --allow-dirty --allow-staged
|
||||
cargo fmt
|
||||
|
||||
Reference in New Issue
Block a user