mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
32 lines
712 B
JavaScript
32 lines
712 B
JavaScript
const fs = require('fs-plus');
|
|
const path = require('path');
|
|
const Watcher = require('./watcher');
|
|
|
|
module.exports = class BaseThemeWatcher extends Watcher {
|
|
constructor() {
|
|
super();
|
|
this.stylesheetsPath = path.dirname(
|
|
atom.themes.resolveStylesheet('../static/atom.less')
|
|
);
|
|
this.watch();
|
|
}
|
|
|
|
watch() {
|
|
const filePaths = fs
|
|
.readdirSync(this.stylesheetsPath)
|
|
.filter(filePath => path.extname(filePath).includes('less'));
|
|
|
|
for (const filePath of filePaths) {
|
|
this.watchFile(path.join(this.stylesheetsPath, filePath));
|
|
}
|
|
}
|
|
|
|
loadStylesheet() {
|
|
this.loadAllStylesheets();
|
|
}
|
|
|
|
loadAllStylesheets() {
|
|
atom.themes.reloadBaseStylesheets();
|
|
}
|
|
};
|