mirror of
https://github.com/ankitects/anki.git
synced 2026-01-09 12:03:56 -05:00
use option_env! instead of rerun-if-env-changed
> As of 1.46, using env! and option_env! in source code will automatically detect changes and trigger rebuilds. https://doc.rust-lang.org/cargo/reference/build-scripts.html#rerun-if-env-changed
This commit is contained in:
parent
74b61d2a1b
commit
9a6842057a
1 changed files with 1 additions and 3 deletions
|
|
@ -8,7 +8,6 @@ mod python;
|
|||
mod typescript;
|
||||
mod write_strings;
|
||||
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anki_io::create_dir_all;
|
||||
|
|
@ -32,8 +31,7 @@ fn main() -> Result<()> {
|
|||
python::write_py_interface(&modules)?;
|
||||
|
||||
// write strings.json file to requested path
|
||||
println!("cargo:rerun-if-env-changed=STRINGS_JSON");
|
||||
if let Ok(path) = env::var("STRINGS_JSON") {
|
||||
if let Some(path) = option_env!("STRINGS_JSON") {
|
||||
if !path.is_empty() {
|
||||
let path = PathBuf::from(path);
|
||||
let meta_json = serde_json::to_string_pretty(&modules).unwrap();
|
||||
|
|
|
|||
Loading…
Reference in a new issue