open.rs 513 B

12345678910111213141516
  1. use super::{ensure_init, env, with_config, Error, MobileTarget};
  2. use crate::Result;
  3. use cargo_mobile::os;
  4. pub fn command() -> Result<()> {
  5. with_config(
  6. Some(Default::default()),
  7. |_root_conf, config, _metadata, _cli_options| {
  8. ensure_init(config.project_dir(), MobileTarget::Ios)
  9. .map_err(|e| Error::ProjectNotInitialized(e.to_string()))?;
  10. let env = env()?;
  11. os::open_file_with("Xcode", config.project_dir(), &env).map_err(Error::OpenFailed)
  12. },
  13. )
  14. .map_err(Into::into)
  15. }