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:
@@ -13,7 +13,8 @@ export const properties: INodeProperties[] = [
|
|||||||
required: true,
|
required: true,
|
||||||
placeholder: 'e.g. /home/user/Pictures/**/*.png',
|
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>',
|
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',
|
displayName: 'Options',
|
||||||
@@ -73,7 +74,12 @@ export async function execute(this: IExecuteFunctions, items: INodeExecutionData
|
|||||||
|
|
||||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
||||||
try {
|
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, {});
|
const options = this.getNodeParameter('options', itemIndex, {});
|
||||||
|
|
||||||
let dataPropertyName = 'data';
|
let dataPropertyName = 'data';
|
||||||
|
|||||||
Reference in New Issue
Block a user