Skip to content

Commit

Permalink
fix: check directory before generating ICU code
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Feb 5, 2023
1 parent 6f8d278 commit 49dee0d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
use std::{env, path::PathBuf};

use rustc_version::{version_meta, Channel};

#[cfg(feature = "normalization")]
fn generate_icu_data() {
use icu_datagen::SourceData;

use std::{env, path::PathBuf};

let mod_directory = PathBuf::from(env::var("OUT_DIR").unwrap()).join("addr_spec_icu");
if mod_directory.exists() {
return;
}

icu_datagen::datagen(
None,
&icu_datagen::keys(&[
Expand All @@ -17,7 +22,7 @@ fn generate_icu_data() {
.with_icuexport_for_tag(SourceData::LATEST_TESTED_ICUEXPORT_TAG)
.unwrap(),
vec![icu_datagen::Out::Module {
mod_directory: PathBuf::from(env::var("OUT_DIR").unwrap()).join("addr_spec_icu"),
mod_directory,
pretty: false,
insert_feature_gates: false,
use_separate_crates: true,
Expand Down

0 comments on commit 49dee0d

Please sign in to comment.