mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-26 22:20:19 +00:00
Set an environment variable during serve for bundling
This commit is contained in:
parent
efe08df966
commit
1ed814668a
2 changed files with 5 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue