MyTrout.Pipelines.Steps.IO.Directories
1.1.0
dotnet add package MyTrout.Pipelines.Steps.IO.Directories --version 1.1.0
NuGet\Install-Package MyTrout.Pipelines.Steps.IO.Directories -Version 1.1.0
<PackageReference Include="MyTrout.Pipelines.Steps.IO.Directories" Version="1.1.0" />
<PackageVersion Include="MyTrout.Pipelines.Steps.IO.Directories" Version="1.1.0" />
<PackageReference Include="MyTrout.Pipelines.Steps.IO.Directories" />
paket add MyTrout.Pipelines.Steps.IO.Directories --version 1.1.0
#r "nuget: MyTrout.Pipelines.Steps.IO.Directories, 1.1.0"
#:package MyTrout.Pipelines.Steps.IO.Directories@1.1.0
#addin nuget:?package=MyTrout.Pipelines.Steps.IO.Directories&version=1.1.0
#tool nuget:?package=MyTrout.Pipelines.Steps.IO.Directories&version=1.1.0
MyTrout.Pipelines.Steps.IO.Directories
Introduction
MyTrout.Pipelines.Steps.IO.Directories provides Pipeline steps to read, write, delete, and move directories on the file system.
MyTrout.Pipelines.Steps.IO.Directories targets .NET 6.0 and .NET 7.0
Pipelines.Hosting runs the Pipeline in a Console Application using Generic Host.
Installing via NuGet
Install-Package MyTrout.Pipelines.Steps.IO.Directories
Software dependencies
1. MyTrout.Pipelines 4.0.0 minimum.
All software dependencies listed above use the MIT License.
How do I use the steps in this library?
sample code
using MyTrout.Pipelines;
using MyTrout.Pipelines.Hosting;
using MyTrout.Pipelines.Steps.Cryptography
using System;
using System.Linq;
using System.Threading.Tasks;
namespace MyTrout.Pipeline.Hosting.Samples
{
public class Program
{
public static async Task Main(string[] args)
{
var host = Host.CreateDefaultBuilder(args)
.AddStepDependency<DeleteFileOptions>()
.UsePipeline(builder =>
{
builder
// The first step doesn't exist and must be user-provided.
.AddStep<LoadTargetFileNameStep>()
.AddStep<DeleteFileStep>()
})
.Build();
//
// IMPORTANT NOTE FOR DEVELOPERS:
//
// Use StartAsync() to allow the caller to review the PipelineContext after execution.
//
await host.StartAsync().ConfigureAwait(false);
var context = host.Services.GetService<PipelineContext>();
if(context.Errors.Any())
{
// TODO: Errors have already been logged, do any special error processing here.
}
return 0;
}
}
}
}
sample appsettings.json file
This configuration provides a base directory to prevent path traversal issues.
{
"DeleteFileBaseDirectory": "C:\"
}
How do I use Pipelines.Hosting with different configurations for different instances of the same step.
If Step1 prints the Step1Options value with a trailing space to the Console when each step is called, then the following code will generate "Moe, Larry & Curly ".
sample code
using MyTrout.Pipelines;
using MyTrout.Pipelines.Hosting;
using MyTrout.Pipelines.Steps.Cryptography
using System;
using System.Linq;
using System.Threading.Tasks;
namespace MyTrout.Pipeline.Hosting.Samples
{
public class Program
{
public static async Task Main(string[] args)
{
// IMPORTANT NOTE FOR DEVELOPERS !
//
// Step Dependencies with context must be defined BEFORE UsePipelines() to load the dependencies correctly.
//
var host = Host.CreateDefaultBuilder(args)
.UsePipeline(builder =>
{
builder
.AddStep<LoadTheFirstMofeFileLocationsStep>()
.AddStep<MoveFileStep, MoveFileOptions>("context-A")
.AddStep<LoadTheSecondMoveFileLocationStep>()
.AddStep<MoveFileStepStep, MoveFileOptions>("context-B")
.AddStep<DoOtherActionsStep>()
})
.Build();
// IMPORTANT NOTE FOR DEVELOPERS !
//
// Use StartAsync() to allow the caller to review the PipelineContext after execution.
//
await host.StartAsync().ConfigureAwait(false);
var context = host.Services.GetService<PipelineContext>();
if(context.Errors.Any())
{
// TODO: Errors have already been logged, do any special error processing here.
}
return 0;
}
}
}
}
sample appsettings.json file
{
"context-A": {
"MoveSourceFileBaseDirectory": "C:\\source\\",
"MoveTargetFileBaseDirectory: "D:\\source\\"
},
"context-B": {
"MoveSourceFileBaseDirectory": "D:\\source\\",
"MoveTargetFileBaseDirectory: "E:\\source\\"
}
}
Build the software locally.
1. Clone the software from the Pipelines repository.
2. Build the software in Visual Studio 2019 to pull down all of the dependencies from nuget.org.
3. In Visual Studio, run all tests. All of the should pass.
4. If you have Visual Studio Enterprise 2019, analyze the code coverage; it should be 100%.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- MyTrout.Pipelines.Steps.IO.Files (>= 4.1.0 && < 5.0.0)
-
net7.0
- MyTrout.Pipelines.Steps.IO.Files (>= 4.1.0 && < 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.