mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
improve config notifications
This commit is contained in:
parent
7ab272a9fe
commit
8c0d94aa1d
2 changed files with 2 additions and 1 deletions
|
|
@ -16,7 +16,6 @@ export default class Config extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
onChange () {
|
onChange () {
|
||||||
new Notification('HyperTerm configuration reloaded!');
|
|
||||||
this.setState({ config: config.getConfig() });
|
this.setState({ config: config.getConfig() });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ const { resolve } = require('path');
|
||||||
const { readFileSync, writeFileSync } = require('fs');
|
const { readFileSync, writeFileSync } = require('fs');
|
||||||
const gaze = require('gaze');
|
const gaze = require('gaze');
|
||||||
const vm = require('vm');
|
const vm = require('vm');
|
||||||
|
const notify = require('./notify');
|
||||||
|
|
||||||
const path = resolve(homedir(), '.hyperterm.js');
|
const path = resolve(homedir(), '.hyperterm.js');
|
||||||
const watchers = [];
|
const watchers = [];
|
||||||
|
|
@ -16,6 +17,7 @@ function watch () {
|
||||||
this.on('changed', () => {
|
this.on('changed', () => {
|
||||||
try {
|
try {
|
||||||
if (exec(readFileSync(path, 'utf8'))) {
|
if (exec(readFileSync(path, 'utf8'))) {
|
||||||
|
notify('HyperTerm configuration reloaded!');
|
||||||
watchers.forEach((fn) => fn());
|
watchers.forEach((fn) => fn());
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue