|
@@ -85,8 +85,21 @@ export class WatcherService {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Get the exts array for this dataset
|
|
|
|
|
- const exts = datasetSettings.exts;
|
|
|
|
|
|
|
+ // Find the specific path configuration that matches this file
|
|
|
|
|
+ let pathConfig = null;
|
|
|
|
|
+ for (const pathKey of Object.keys(datasetSettings)) {
|
|
|
|
|
+ if (pathKey !== 'enabled' && filePath.startsWith(pathKey)) {
|
|
|
|
|
+ pathConfig = datasetSettings[pathKey];
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!pathConfig) {
|
|
|
|
|
+ return false; // File path doesn't match any configured path in the dataset
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Get the exts array for this path
|
|
|
|
|
+ const exts = pathConfig.exts;
|
|
|
if (!exts || !Array.isArray(exts) || exts.length === 0) {
|
|
if (!exts || !Array.isArray(exts) || exts.length === 0) {
|
|
|
// If no exts specified, watch all files (backward compatibility)
|
|
// If no exts specified, watch all files (backward compatibility)
|
|
|
return true;
|
|
return true;
|
|
@@ -158,8 +171,24 @@ export class WatcherService {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Check if file extension matches the dataset's exts array
|
|
|
|
|
- const exts = datasetSettings.exts;
|
|
|
|
|
|
|
+ // Find the specific path configuration that matches this file
|
|
|
|
|
+ let pathConfig = null;
|
|
|
|
|
+ for (const pathKey of Object.keys(datasetSettings)) {
|
|
|
|
|
+ if (pathKey !== 'enabled' && file.startsWith(pathKey)) {
|
|
|
|
|
+ pathConfig = datasetSettings[pathKey];
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!pathConfig) {
|
|
|
|
|
+ this.logger.warn(
|
|
|
|
|
+ `File path ${file} doesn't match any configured path in dataset ${dataset}`,
|
|
|
|
|
+ );
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Check if file extension matches the path's exts array
|
|
|
|
|
+ const exts = pathConfig.exts;
|
|
|
if (exts && Array.isArray(exts) && exts.length > 0) {
|
|
if (exts && Array.isArray(exts) && exts.length > 0) {
|
|
|
const fileExt = path.extname(file).toLowerCase();
|
|
const fileExt = path.extname(file).toLowerCase();
|
|
|
const extensionMatches = exts.some((ext: string) => {
|
|
const extensionMatches = exts.some((ext: string) => {
|