ditto for STRINGS_PY and STRINGS_TS

This commit is contained in:
llama 2025-11-20 20:28:43 +08:00
parent 9a6842057a
commit 1882ae336f
No known key found for this signature in database
GPG key ID: 0B7543854B9413C3
2 changed files with 2 additions and 4 deletions

View file

@ -1,7 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
use std::env;
use std::fmt::Write;
use std::path::PathBuf;
@ -21,7 +20,7 @@ pub fn write_py_interface(modules: &[Module]) -> Result<()> {
render_methods(modules, &mut out);
render_legacy_enum(modules, &mut out);
if let Ok(path) = env::var("STRINGS_PY") {
if let Some(path) = option_env!("STRINGS_PY") {
let path = PathBuf::from(path);
create_dir_all(path.parent().unwrap())?;
write_file_if_changed(path, out)?;

View file

@ -1,7 +1,6 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
use std::env;
use std::fmt::Write;
use std::path::PathBuf;
@ -22,7 +21,7 @@ pub fn write_ts_interface(modules: &[Module]) -> Result<()> {
render_module_map(modules, &mut ts_out);
render_methods(modules, &mut ts_out);
if let Ok(path) = env::var("STRINGS_TS") {
if let Some(path) = option_env!("STRINGS_TS") {
let path = PathBuf::from(path);
create_dir_all(path.parent().unwrap())?;
write_file_if_changed(path, ts_out)?;