1 Star 1 Fork 0

极性水溶小白鸟/NISBuildD

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.js 720 Bytes
一键复制 编辑 原始数据 按行查看 历史
unknown 提交于 2021-01-11 08:02 . first commit
const { watch } = require('chokidar')
const { chdir } = require('process')
const { exec, exit } = require('child_process')
chdir('/var/yp')
const handler = (changeEvent, changedFilename) => {
console.log(`File ${changedFilename} ${changeEvent}`)
const executor = exec('make')
executor.on('error', (code) => {
console.log(`Process got an error with code ${code}`)
})
executor.on('exit', (code) => {
console.log(`Process finished and exited with code ${code}`)
})
}
const fileWatcher = watch()
fileWatcher.add([
'/etc/passwd', '/etc/group', '/etc/shadow', '/etc/gshadow'
])
fileWatcher.on('all', handler)
fileWatcher.on('error', err => {
console.log(err)
exit(1)
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qihexiang/nisbuildd.git
git@gitee.com:qihexiang/nisbuildd.git
qihexiang
nisbuildd
NISBuildD
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385