Fruitbasket 0.5, handle launching on non-OS-X
ctrlc = "3.0.1"
[dependencies.fruitbasket]
-version = "0.4"
+version = "0.5"
features = ["logging"]
[target."cfg(windows)".dependencies]
use rubrail::SwipeState;
extern crate fruitbasket;
+use fruitbasket::FruitApp;
+use fruitbasket::FruitError;
extern crate ctrlc;
use std::sync::atomic::{AtomicBool, Ordering};
.join("LICENSE");
let ini = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("connectr.ini.in");
- if let Ok(nsapp) = fruitbasket::Trampoline::new(
+ let nsapp = match fruitbasket::Trampoline::new(
"Connectr", "connectr", "com.trevorbentley.connectr")
.icon("connectr.icns")
.version(env!("CARGO_PKG_VERSION"))
.resource(license.to_str().unwrap())
.resource(ini.to_str().unwrap())
.build(fruitbasket::InstallDir::Custom("target/".to_string())) {
- nsapp.set_activation_policy(fruitbasket::ActivationPolicy::Prohibited);
- }
- else {
- error!("Failed to create OS X bundle!");
- std::process::exit(1);
- }
-
+ Ok(app) => { app },
+ Err(FruitError::UnsupportedPlatform(_)) => { FruitApp::new() },
+ _ => {
+ error!("Couldn't create Mac app bundle.");
+ std::process::exit(1);
+ },
+ };
+ nsapp.set_activation_policy(fruitbasket::ActivationPolicy::Prohibited);
info!("Started Connectr");
let running = Arc::new(AtomicBool::new(true));