fix(SmartFsProviderNode): Fix Node provider watch path handling and remove main test entry
This commit is contained in:
@@ -266,6 +266,10 @@ export class SmartFsProviderNode implements ISmartFsProvider {
|
||||
// --- Watch Operations ---
|
||||
|
||||
public async watch(path: string, callback: TWatchCallback, options?: IWatchOptions): Promise<IWatcherHandle> {
|
||||
// Check once at start if we're watching a file or directory
|
||||
const watchedStats = await fs.stat(path);
|
||||
const isWatchingFile = watchedStats.isFile();
|
||||
|
||||
const watcher = fsSync.watch(
|
||||
path,
|
||||
{
|
||||
@@ -274,7 +278,8 @@ export class SmartFsProviderNode implements ISmartFsProvider {
|
||||
async (eventType, filename) => {
|
||||
if (!filename) return;
|
||||
|
||||
const fullPath = pathModule.join(path, filename);
|
||||
// For file watching, path IS the file; for directory, join with filename
|
||||
const fullPath = isWatchingFile ? path : pathModule.join(path, filename);
|
||||
|
||||
// Apply filter
|
||||
if (options?.filter && !this.matchesPathFilter(fullPath, options.filter)) {
|
||||
|
||||
Reference in New Issue
Block a user