Skip to content

Commit 8ff830d

Browse files
committed
improve the copy
1 parent ff29b9b commit 8ff830d

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

packages/nodes-base/nodes/LocalFileTrigger/LocalFileTrigger.node.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class LocalFileTrigger implements INodeType {
148148
default: '',
149149
placeholder: '**/*.txt or ignore-me/subfolder',
150150
description:
151-
'Files or paths to ignore. The whole path is tested, not just the filename. Supports <a href="https://github.com/micromatch/anymatch">Anymatch</a>- syntax.',
151+
"Files or paths to ignore. The whole path is tested, not just the filename. Supports <a href=\"https://github.com/micromatch/anymatch\">Anymatch</a>- syntax. Regex patterns may not work on macOS. To ignore files based on substring matching, use the 'Ignore Mode' option with 'Contain'.",
152152
},
153153
{
154154
displayName: 'Ignore Existing Files/Folders',
@@ -208,19 +208,20 @@ export class LocalFileTrigger implements INodeType {
208208
type: 'options',
209209
options: [
210210
{
211-
name: 'Regex',
212-
value: 'regex',
213-
description: 'Use regex patterns (e.g., **/*.txt)',
211+
name: 'Match',
212+
value: 'match',
213+
description:
214+
'Ignore files using regex patterns (e.g., **/*.txt), Not supported on macOS',
214215
},
215216
{
216-
name: 'Function',
217-
value: 'function',
218-
description:
219-
'Wraps the ignored value in a function that checks if the file path includes the ignored value',
217+
name: 'Contain',
218+
value: 'contain',
219+
description: 'Ignore files if their path contains the specified value',
220220
},
221221
],
222-
default: 'regex',
223-
description: 'Whether to use regex Anymatch patterns or a function to ignore files',
222+
default: 'match',
223+
description:
224+
'Whether to ignore files using regex matching (Anymatch patterns) or by checking if the path contains a specified value',
224225
},
225226
],
226227
},
@@ -240,7 +241,7 @@ export class LocalFileTrigger implements INodeType {
240241
}
241242
const ignored = options.ignored === '' ? undefined : (options.ignored as string);
242243
const watcher = watch(path, {
243-
ignored: options.ignoreMode === 'regex' ? ignored : (x) => x.includes(ignored as string),
244+
ignored: options.ignoreMode === 'match' ? ignored : (x) => x.includes(ignored as string),
244245
persistent: true,
245246
ignoreInitial:
246247
options.ignoreInitial === undefined ? true : (options.ignoreInitial as boolean),

packages/nodes-base/nodes/LocalFileTrigger/__test__/LocalFileTrigger.node.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ describe('LocalFileTrigger', () => {
3232
jest.clearAllMocks();
3333
});
3434

35-
it('should set up chokidar with correct options for folder + regex ignore', async () => {
35+
it('should set up chokidar with correct options for folder + match ignore', async () => {
3636
(context.getNodeParameter as jest.Mock)
3737
.mockReturnValueOnce('folder')
3838
.mockReturnValueOnce('/some/folder')
3939
.mockReturnValueOnce({
4040
ignored: '**/*.txt',
41-
ignoreMode: 'regex',
41+
ignoreMode: 'match',
4242
ignoreInitial: true,
4343
followSymlinks: true,
4444
depth: 1,
@@ -64,13 +64,13 @@ describe('LocalFileTrigger', () => {
6464
expect(mockWatcher.on).toHaveBeenCalledWith('add', expect.any(Function));
6565
});
6666

67-
it('should wrap ignored in function for ignoreMode=function', async () => {
67+
it('should wrap ignored in function for ignoreMode=contain', async () => {
6868
(context.getNodeParameter as jest.Mock)
6969
.mockReturnValueOnce('folder')
7070
.mockReturnValueOnce('/folder')
7171
.mockReturnValueOnce({
7272
ignored: 'node_modules',
73-
ignoreMode: 'function',
73+
ignoreMode: 'contain',
7474
})
7575
.mockReturnValueOnce(['change']);
7676

0 commit comments

Comments
 (0)