|
@@ -12,6 +12,10 @@ pub fn copy_assets() {
|
|
)
|
|
)
|
|
))]
|
|
))]
|
|
{
|
|
{
|
|
|
|
+ // The CLI will copy assets to the current working directory
|
|
|
|
+ if std::env::var_os("DIOXUS_ACTIVE").is_some() {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
use manganis_cli_support::AssetManifest;
|
|
use manganis_cli_support::AssetManifest;
|
|
use manganis_cli_support::AssetManifestExt;
|
|
use manganis_cli_support::AssetManifestExt;
|
|
use manganis_cli_support::Config;
|
|
use manganis_cli_support::Config;
|
|
@@ -21,6 +25,7 @@ pub fn copy_assets() {
|
|
let asset_location = PathBuf::from(asset_location);
|
|
let asset_location = PathBuf::from(asset_location);
|
|
let _ = std::fs::remove_dir_all(&asset_location);
|
|
let _ = std::fs::remove_dir_all(&asset_location);
|
|
|
|
|
|
|
|
+ println!("Finding assets... (Note: if you run a dioxus desktop application with the CLI. This process will be significantly faster.)");
|
|
let manifest = AssetManifest::load();
|
|
let manifest = AssetManifest::load();
|
|
let has_assets = manifest
|
|
let has_assets = manifest
|
|
.packages()
|
|
.packages()
|
|
@@ -31,6 +36,8 @@ pub fn copy_assets() {
|
|
println!("Copying and optimizing assets...");
|
|
println!("Copying and optimizing assets...");
|
|
manifest.copy_static_assets_to(&asset_location).unwrap();
|
|
manifest.copy_static_assets_to(&asset_location).unwrap();
|
|
println!("Copied assets to {}", asset_location.display());
|
|
println!("Copied assets to {}", asset_location.display());
|
|
|
|
+ } else {
|
|
|
|
+ println!("No assets found");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#[cfg(not(all(
|
|
#[cfg(not(all(
|