From 366d74abbee14ebc2f5f3d1b24d9ef5bf9024638 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sat, 28 Oct 2023 20:50:57 +0900 Subject: [PATCH] =?UTF-8?q?test=5Futil=E3=81=8COpenJTalk=E3=81=AE=E8=BE=9E?= =?UTF-8?q?=E6=9B=B8=E3=82=92=E5=B8=B8=E3=81=AB=E5=86=8D=E3=83=80=E3=82=A6?= =?UTF-8?q?=E3=83=B3=E3=83=AD=E3=83=BC=E3=83=89=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/test_util/build.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/test_util/build.rs b/crates/test_util/build.rs index 1d667cd9e..eae3ac286 100644 --- a/crates/test_util/build.rs +++ b/crates/test_util/build.rs @@ -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(()) }