Fix cargo run flow without FRACTAL_LOCALEDIR env

In the build.rs we're looking for the FRACTAL_LOCALEDIR env variable
that is written by the cargo.sh script ran by meson but if we want to
run this for development we can't use cargo run because that env doesn't
exists so we'll use fractal-gtk/po as default.
This commit is contained in:
Daniel García Moreno 2018-05-18 13:24:25 +02:00
parent d4101ccbe4
commit 0cce5a47ab

View file

@ -13,8 +13,9 @@ fn main() {
.unwrap();
// Generating build globals
let default_locales = "./fractal-gtk/po".to_string();
let out_dir = env::var("OUT_DIR").unwrap();
let localedir = env::var("FRACTAL_LOCALEDIR").unwrap();
let localedir = env::var("FRACTAL_LOCALEDIR").unwrap_or(default_locales);
let dest_path = Path::new(&out_dir).join("build_globals.rs");
let mut f = File::create(&dest_path).unwrap();