mirror of
https://github.com/atom/atom.git
synced 2026-02-09 06:05:11 -05:00
32 lines
705 B
JavaScript
32 lines
705 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()
|
|
}
|
|
}
|