1
0

devcfg.rs 1.0 KB

123456789101112131415161718192021222324252627282930
  1. //! Configuration of the CLI at runtime to enable certain experimental features.
  2. use std::path::Path;
  3. /// Should we cache the dependency library?
  4. ///
  5. /// When the `DIOXUS_CACHE_DEP_LIB` environment variable is set, we will cache the dependency library
  6. /// built from the target's dependencies.
  7. pub(crate) fn should_cache_dep_lib(lib: &Path) -> bool {
  8. std::env::var("DIOXUS_CACHE_DEP_LIB").is_ok() && lib.exists()
  9. }
  10. /// Should we force the entropy to be used on the main exe?
  11. ///
  12. /// This is used to verify that binaries are copied with different names such that they don't collide
  13. /// and should generally be only enabled on certain platforms that require it.
  14. pub(crate) fn should_force_entropy() -> bool {
  15. std::env::var("DIOXUS_FORCE_ENTRY").is_ok()
  16. }
  17. /// Should the CLI not download any additional tools?
  18. pub(crate) fn no_downloads() -> bool {
  19. std::env::var("NO_DOWNLOADS").is_ok()
  20. }
  21. /// Should we test the installs?
  22. #[allow(dead_code)] // -> used in tests only
  23. pub(crate) fn test_installs() -> bool {
  24. std::env::var("TEST_INSTALLS").is_ok()
  25. }