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;
|
use std::env;
|
||||||
|
|
||||||
const APP_ID_DEV: &str = "com.luminescent-dreams.fitnesstrax.dev";
|
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_DEV: &str = "/com/luminescent-dreams/fitnesstrax/dev/";
|
||||||
|
const RESOURCE_BASE_PATH_PROD: &str = "/com/luminescent-dreams/fitnesstrax/";
|
||||||
|
|
||||||
struct AppState {}
|
struct AppState {}
|
||||||
|
|
||||||
|
@ -13,10 +14,11 @@ struct AppWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
let (app_id, base_path) = if std::env::var_os("ENV") == Some("dev".into()) {
|
||||||
|
(APP_ID_DEV, RESOURCE_BASE_PATH_DEV)
|
||||||
let app_id = APP_ID_DEV;
|
} else {
|
||||||
let base_path = RESOURCE_BASE_PATH_DEV;
|
(APP_ID_PROD, RESOURCE_BASE_PATH_PROD)
|
||||||
|
};
|
||||||
|
|
||||||
let settings = gio::Settings::new(app_id);
|
let settings = gio::Settings::new(app_id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue