// Compiled by ClojureScript 1.9.562 {:target :nodejs}
goog.provide('weathergen.settings');
goog.require('cljs.core');
goog.require('cljs.nodejs');
goog.require('cljs.reader');
goog.require('taoensso.timbre');
goog.require('weathergen.filesystem');
weathergen.settings.electron = cljs.nodejs.require.call(null,"electron");
weathergen.settings.remote = weathergen.settings.electron.remote;
weathergen.settings.remote_if_necessary = (function weathergen$settings$remote_if_necessary(electron){
if(cljs.core._EQ_.call(null,"renderer",process.type)){
return weathergen.settings.remote;
} else {
return electron;
}
});
weathergen.settings.app = (function weathergen$settings$app(){
if(cljs.core._EQ_.call(null,"renderer",process.type)){
return weathergen.settings.remote.app;
} else {
return weathergen.settings.electron.app;
}
});
weathergen.settings.app_dir = weathergen.filesystem.path_combine.call(null,weathergen.settings.app.call(null).getPath("appData"),"craigandera.org","VMT");
weathergen.settings.settings_path = weathergen.filesystem.path_combine.call(null,weathergen.settings.app_dir,"settings.edn");
weathergen.settings.load_settings = (function weathergen$settings$load_settings(){
if(cljs.core.truth_(weathergen.filesystem.exists_QMARK_.call(null,weathergen.settings.settings_path))){
return cljs.reader.read_string.call(null,weathergen.filesystem.file_text.call(null,weathergen.settings.settings_path));
} else {
return null;
}
});
