Set an environment variable during serve for bundling

This commit is contained in:
Evan Almloff committed 2023-08-18 11:12:56 -05:00
1 parent efe08df966
commit 1ed814668a
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -240,7 +240,10 @@ pub fn start_desktop(config: &CrateConfig) -> Result<(Child, BuildResult)> {
if cfg!(windows) {
file.set_extension("exe");
}
let child = Command::new(file.to_str().unwrap()).spawn()?;
let active = "DIOXUS_ACTIVE";
let child = Command::new(file.to_str().unwrap())
.env(active, "true")
.spawn()?;
Ok((child, result))
}
+1 -1
View File
@@ -158,7 +158,7 @@ fn get_asset_root() -> Option<PathBuf> {
*/
if std::env::var_os("CARGO").is_some() {
if std::env::var_os("CARGO").is_some() || std::env::var_os("DIOXUS_ACTIVE").is_some() {
return None;
}