From 701d19cd45d5c6e91299f78c96c1abcb099f3339 Mon Sep 17 00:00:00 2001 From: John Andrews Date: Thu, 10 Feb 2022 08:20:14 +1300 Subject: [PATCH] added original file node --- BasicNodes/BasicNodes.csproj | Bin 3778 -> 3778 bytes BasicNodes/BasicNodes.en.json | 6 ++++++ BasicNodes/File/OriginalFile.cs | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 BasicNodes/File/OriginalFile.cs diff --git a/BasicNodes/BasicNodes.csproj b/BasicNodes/BasicNodes.csproj index 0c1d32925084f6428919c8118002893bbbb839c6..1ec8318f1b4082e062a7b1f37f71e20aa094b563 100644 GIT binary patch delta 24 dcmX>kdq{S}D@JBh27}3O8N)&JW_PA)9sq022ZaCt delta 24 dcmX>kdq{S}D@JA$28+pW8N)&JW_PA)9sq1r2a^B* diff --git a/BasicNodes/BasicNodes.en.json b/BasicNodes/BasicNodes.en.json index d02974f9..7e9c13c7 100644 --- a/BasicNodes/BasicNodes.en.json +++ b/BasicNodes/BasicNodes.en.json @@ -183,6 +183,12 @@ "DeleteOriginal-Help": "If the original file should be deleted, this will only happen if the working file is different to the original file" } }, + "OriginalFile": { + "Description": "Sets the current working file in the flow to the original file that started the flow", + "Outputs": { + "1": "Working file set to original file" + } + }, "PatternMatch": { "Description": "Tests the working file and original file against a regular expression.\n\nOutput 1: Matches expression\nOutput 2: Does not match", "Outputs": { diff --git a/BasicNodes/File/OriginalFile.cs b/BasicNodes/File/OriginalFile.cs new file mode 100644 index 00000000..4c1e9ee4 --- /dev/null +++ b/BasicNodes/File/OriginalFile.cs @@ -0,0 +1,21 @@ +namespace FileFlows.BasicNodes.File +{ + using System.Text; + using System.Text.RegularExpressions; + using FileFlows.Plugin; + + public class OriginalFile : Node + { + public override int Inputs => 1; + public override int Outputs => 1; + public override string Icon => "fas fa-file"; + public override FlowElementType Type => FlowElementType.Logic; + + public override int Execute(NodeParameters args) + { + args.SetWorkingFile(args.FileName); + args.Logger?.ILog("Set working file to: " + args.FileName); + return 1; + } + } +}