()
| 29 | } |
| 30 | |
| 31 | save() { |
| 32 | if (this.mod && this.mod !== this.getMod()) return; // File was last modified after Settings was made, so was externally edited therefore we don't save over |
| 33 | |
| 34 | try { |
| 35 | fs.writeFileSync(this.path, JSON.stringify(this.store, null, 2)); |
| 36 | this.mod = this.getMod(); |
| 37 | |
| 38 | log('Settings', 'Saved'); |
| 39 | } catch (e) { |
| 40 | log('Settings', e); |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | let inst; // Instance of class |