Set up an environment variable to toggle between dev and production schemas
This commit is contained in:
parent
f3a453d151
commit
a7d6d82ec2
|
@ -2,9 +2,10 @@ use gtk::prelude::*;
|
|||
use std::env;
|
||||
|
||||
const APP_ID_DEV: &str = "com.luminescent-dreams.fitnesstrax.dev";
|
||||
// const APP_ID_PROD: &str = "com.luminescent-dreams.fitnesstrax";
|
||||
const APP_ID_PROD: &str = "com.luminescent-dreams.fitnesstrax";
|
||||
|
||||
const RESOURCE_BASE_PATH_DEV: &str = "/com/luminescent-dreams/fitnesstrax/dev/";
|
||||
const RESOURCE_BASE_PATH_PROD: &str = "/com/luminescent-dreams/fitnesstrax/";
|
||||
|
||||
struct AppState {}
|
||||
|
||||
|
@ -13,10 +14,11 @@ struct AppWindow {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
|
||||
let app_id = APP_ID_DEV;
|
||||
let base_path = RESOURCE_BASE_PATH_DEV;
|
||||
let (app_id, base_path) = if std::env::var_os("ENV") == Some("dev".into()) {
|
||||
(APP_ID_DEV, RESOURCE_BASE_PATH_DEV)
|
||||
} else {
|
||||
(APP_ID_PROD, RESOURCE_BASE_PATH_PROD)
|
||||
};
|
||||
|
||||
let settings = gio::Settings::new(app_id);
|
||||
|
||||
|
|
Loading…
Reference in New Issue