mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-05 00:52:59 +01:00
27 lines
441 B
JavaScript
27 lines
441 B
JavaScript
const fs = require('fs');
|
|
|
|
const settingsPath = "./conf.json"
|
|
|
|
|
|
function getSettings(){
|
|
|
|
if (!fs.existsSync(settingsPath)) {
|
|
return {};
|
|
}
|
|
else{
|
|
let rawSettings = fs.readFileSync(settingsPath);
|
|
return JSON.parse(rawSettings);
|
|
}
|
|
}
|
|
|
|
|
|
function setSettings(settings){
|
|
fs.writeFileSync(settingsPath, JSON.stringify(settings));
|
|
}
|
|
|
|
|
|
exports.getSettings = getSettings;
|
|
exports.setSettings = setSettings;
|
|
|
|
|