mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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,
|
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';
|
||||||
|
|
Loading…
Reference in a new issue