mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
fix(Read/Write Files from Disk Node): Notice update in file selector, replace backslashes with forward slashes if windows path (#10186)
This commit is contained in:
parent
eb9c69c595
commit
3eac673b17
|
@ -13,7 +13,8 @@ export const properties: INodeProperties[] = [
|
|||
required: true,
|
||||
placeholder: 'e.g. /home/user/Pictures/**/*.png',
|
||||
hint: 'Supports patterns, learn more <a href="https://github.com/micromatch/picomatch#basic-globbing" target="_blank">here</a>',
|
||||
description: "Specify a file's path or path pattern to read multiple files",
|
||||
description:
|
||||
"Specify a file's path or path pattern to read multiple files. Always use forward-slashes for path separator even on Windows.",
|
||||
},
|
||||
{
|
||||
displayName: 'Options',
|
||||
|
@ -73,7 +74,12 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||
|
||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
||||
try {
|
||||
fileSelector = this.getNodeParameter('fileSelector', itemIndex) as string;
|
||||
fileSelector = String(this.getNodeParameter('fileSelector', itemIndex));
|
||||
|
||||
if (/^[a-zA-Z]:/.test(fileSelector)) {
|
||||
fileSelector = fileSelector.replace(/\\\\/g, '/');
|
||||
}
|
||||
|
||||
const options = this.getNodeParameter('options', itemIndex, {});
|
||||
|
||||
let dataPropertyName = 'data';
|
||||
|
|
Loading…
Reference in a new issue