mirror of
https://github.com/cubixle/radius-rs.git
synced 2026-04-25 02:14:42 +01:00
26 lines
560 B
Bash
Executable File
26 lines
560 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##*.}"
|
|
(cd "${REPO_ROOT}/code_generator"; cargo run "${DICTS_DIR}/dictionary.${DICT_NAME}" "${SRC_DIR}/${DICT_NAME}.rs")
|
|
done
|
|
|
|
cargo fix --allow-dirty --allow-staged
|
|
cargo fmt
|
|
|