mirror of
https://github.com/cubixle/radius-rs.git
synced 2026-04-25 01:54:47 +01:00
25 lines
500 B
Bash
Executable File
25 lines
500 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
REPO_ROOT="$(cd ./"$(git rev-parse --show-cdup)" || exit; pwd)"
|
|
DICTS_DIR="${REPO_ROOT}/dicts"
|
|
SRC_DIR="${REPO_ROOT}/src"
|
|
|
|
DICTS=$(ls "$DICTS_DIR")
|
|
|
|
# shellcheck disable=SC2068
|
|
for DICT in ${DICTS[@]}; do
|
|
DICT_NAME="${DICT##*.}"
|
|
cat /dev/null > "${SRC_DIR}/${DICT_NAME}.rs"
|
|
done
|
|
|
|
# shellcheck disable=SC2068
|
|
for DICT in ${DICTS[@]}; do
|
|
DICT_NAME="${DICT##*.}"
|
|
cargo run --bin code_gen "${DICTS_DIR}/dictionary.${DICT_NAME}" "${SRC_DIR}/${DICT_NAME}.rs"
|
|
done
|
|
|
|
cargo fmt
|
|
|