Skip to content

Commit

Permalink
120
Browse files Browse the repository at this point in the history
  • Loading branch information
beiranvand-karim committed Sep 4, 2024
1 parent fe95880 commit b1dba71
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using cross_application_feature_development_management.Dirctories.Feature.AutomationsDirectory;
using cross_application_feature_development_management.Dirctories.Feature.AutomationsDirectory.BatchScriptFilesDirectory;
using cross_application_feature_development_management.Dirctories.Interfaces;
using cross_application_feature_development_management.Interfaces;
Expand All @@ -16,7 +17,8 @@ public class CrossApplicationFeatureDevelopmentManagement(
IPowerShellScriptsDirectory powerShellScriptsDirectory,
IBatchScriptsDicrectory batchScriptsDicrectory,
ISomething something,
IBatchScriptFilesDirectory batchScriptFilesDirectory
IBatchScriptFilesDirectory batchScriptFilesDirectory,
IAutomationsDirectory automationsDirectory
)
: ICrossApplicationFeatureDevelopmentManagement
{
Expand All @@ -30,6 +32,7 @@ IBatchScriptFilesDirectory batchScriptFilesDirectory
private readonly IBatchScriptsDicrectory batchScriptsDicrectory = batchScriptsDicrectory;
private readonly ISomething something = something;
private readonly IBatchScriptFilesDirectory batchScriptFilesDirectory = batchScriptFilesDirectory;
private readonly IAutomationsDirectory automationsDirectory = automationsDirectory;

public void Run()
{
Expand All @@ -43,6 +46,8 @@ public void Run()

featureNameDirectory.CreateSelf();

automationsDirectory.Create();

Directory.CreateDirectory(environmentVariablesFilesDirectory.CreatePathToSelfInFeatureNameDirectory());
string destinationDirectory = environmentVariablesFilesDirectory.CreatePathToSelfInFeatureNameDirectory();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using cross_application_feature_development_management.Dirctories.Feature.AutomationsDirectory;
using cross_application_feature_development_management.Dirctories.Interfaces;
using cross_application_feature_development_management.Interfaces;

Expand All @@ -8,14 +9,16 @@ public class EnvironmentVariablesFilesDirectory(
IFeatureNameDirectory featureNameDirectory,
ICommandLineArgs commandLineArgs,
ITargetDirectory targetDirectory,
IDirectories directories
IDirectories directories,
IAutomationsDirectory automationsDirectory
) : IEnvironmentVariablesFilesDirectory
{
private readonly IScriptsDirectory scriptsDirectory = scriptsDirectory;
private readonly IFeatureNameDirectory featureNameDirectory = featureNameDirectory;
private readonly ICommandLineArgs commandLineArgs = commandLineArgs;
private readonly ITargetDirectory targetDirectory = targetDirectory;
private readonly IDirectories directories = directories;
private readonly IAutomationsDirectory automationsDirectory = automationsDirectory;

public void CopyContentToFeatureNameDicrectory()
{
Expand All @@ -42,7 +45,7 @@ public string CreatePathToSelfInScriptsDirectory()

public string CreatePathToSelfInFeatureNameDirectory()
{
string destinationDirectory = featureNameDirectory.GetPath();
string destinationDirectory = automationsDirectory.GetPath();
string environmentVariablesFilesDirectory = Path.Combine(destinationDirectory, "environment-variables-files");
return environmentVariablesFilesDirectory;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using cross_application_feature_development_management.Dirctories.Feature.AutomationsDirectory;
using cross_application_feature_development_management.Dirctories.Interfaces;
using Microsoft.Extensions.Logging;

Expand All @@ -9,6 +10,7 @@ public class PowerShellScriptsDirectory(
IScriptsDirectory scriptsDirectory,
IFeatureNameDirectory featureNameDirectory,
IDirectories directories,
IAutomationsDirectory automationsDirectory,
ILogger<PowerShellScriptsDirectory> logger
) : IPowerShellScriptsDirectory
{
Expand All @@ -17,6 +19,7 @@ ILogger<PowerShellScriptsDirectory> logger
private readonly IScriptsDirectory scriptsDirectory = scriptsDirectory;
private readonly IFeatureNameDirectory featureNameDirectory = featureNameDirectory;
private readonly IDirectories directories = directories;
private readonly IAutomationsDirectory automationsDirectory = automationsDirectory;
private readonly ILogger<PowerShellScriptsDirectory> logger = logger;

public void ReplaceFileNamesWithPaths()
Expand Down Expand Up @@ -77,7 +80,7 @@ public string ConstructPathToSelfInScriptsDirectory(string direcName)

public string ConstructPathToSelfInFeatureNameDirectory(string direcName)
{
string destinationDirectory = featureNameDirectory.GetPath();
string destinationDirectory = automationsDirectory.GetPath();
string environmentVariablesFilesDirectory = Path.Combine(destinationDirectory, direcName);
return environmentVariablesFilesDirectory;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using cross_application_feature_development_management.Dirctories.Interfaces;

namespace cross_application_feature_development_management.Dirctories.Feature.AutomationsDirectory
{
public interface IAutomationsDirectory
{
public string GetPath();
public void Create();
}


public class AutomationsDirectory(
IFeatureNameDirectory featureNameDirectory
) : IAutomationsDirectory
{
private readonly IFeatureNameDirectory featureNameDirectory = featureNameDirectory;

public void Create()
{
var path = GetPath();
Directory.CreateDirectory(path);
}
public string GetPath()
{
string directory = featureNameDirectory.GetPath();
string automationsDirectory = Path.Combine(directory, "automations");
return automationsDirectory;
}
}
}
2 changes: 2 additions & 0 deletions cross-application-feature-development-management/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using cross_application_feature_development_management.Combiners.Interfaces;
using cross_application_feature_development_management.Dirctories;
using cross_application_feature_development_management.Dirctories.Classes;
using cross_application_feature_development_management.Dirctories.Feature.AutomationsDirectory;
using cross_application_feature_development_management.Dirctories.Feature.AutomationsDirectory.BatchScriptFilesDirectory;
using cross_application_feature_development_management.Dirctories.Feature.EnvironmentVariablesTemplateFiles;
using cross_application_feature_development_management.Dirctories.Interfaces;
Expand Down Expand Up @@ -56,6 +57,7 @@ private static void Main(string[] args)
services.AddTransient<IFeatureName, FeatureName>();
services.AddTransient<INotePadPlusPlusOpenAll, NotePadPlusPlusOpenAll>();
services.AddTransient<IBatchScriptFilesDirectory, BatchScriptFilesDirectory>();
services.AddTransient<IAutomationsDirectory, AutomationsDirectory>();
})
.UseSerilog()
.Build();
Expand Down

0 comments on commit b1dba71

Please sign in to comment.