mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-31 07:35:24 +00:00
fix: test
This commit is contained in:
1 parent
a0e13f9eeb
commit
ef5057c45c
1 file changed
+12
-3
+12
-3
@@ -580,9 +580,18 @@ function watchPlugins(dir) {
|
|||||||
queue(() => rebuildPlugin(byId.get(id))),
|
queue(() => rebuildPlugin(byId.get(id))),
|
||||||
);
|
);
|
||||||
for (const plugin of plugins) {
|
for (const plugin of plugins) {
|
||||||
watch(plugin.repo, true, (_event, filename) => {
|
// Only source folders, so node_modules and .git are never watched
|
||||||
if (isPluginEdit(plugin.repo, filename)) changed(plugin.id);
|
const onEvent = (prefix) => (_event, filename) => {
|
||||||
});
|
const name = prefix
|
||||||
|
? path.join(prefix, String(filename ?? ""))
|
||||||
|
: filename;
|
||||||
|
if (isPluginEdit(plugin.repo, name)) changed(plugin.id);
|
||||||
|
};
|
||||||
|
watch(plugin.repo, false, onEvent(""));
|
||||||
|
for (const sub of ["src", "locales", "migrations"]) {
|
||||||
|
const target = path.join(plugin.repo, sub);
|
||||||
|
if (fs.existsSync(target)) watch(target, true, onEvent(sub));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log(`watching ${plugins.length} plugin(s) in ${dir}`);
|
log(`watching ${plugins.length} plugin(s) in ${dir}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user