Skip to content

Commit

Permalink
test_utilがOpenJTalkの辞書を常に再ダウンロードしないようにする
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Oct 28, 2023
1 parent d252b81 commit 366d74a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crates/test_util/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,17 @@ const DIC_DIR_NAME: &str = "open_jtalk_dic_utf_8-1.11";
async fn main() -> anyhow::Result<()> {
let mut dist = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
dist.push("data");
download_open_jtalk_dict(&dist).await?;

let dic_dir = dist.join(DIC_DIR_NAME);
if !dic_dir.try_exists()? {
download_open_jtalk_dict(&dist).await?;
ensure!(dic_dir.exists(), "`{}` does not exist", dic_dir.display());
}

generate_example_data_json(&dist)?;

println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=src/typing.rs");
Ok(())
}

Expand Down

0 comments on commit 366d74a

Please sign in to comment.