person-key-to-immich-import birthday json (Day-Helper-2024-05-18)
csharp_prefer_braces = true
This commit is contained in:
@ -3,11 +3,9 @@ using System.Diagnostics;
|
||||
|
||||
namespace File_Folder_Helper.ADO2024.PI2;
|
||||
|
||||
internal static partial class Helper20240429
|
||||
{
|
||||
internal static partial class Helper20240429 {
|
||||
|
||||
internal static void GitConfigCleanUp(ILogger<Worker> logger, List<string> args)
|
||||
{
|
||||
internal static void GitConfigCleanUp(ILogger<Worker> logger, List<string> args) {
|
||||
string[] files;
|
||||
Process? process;
|
||||
string? directory;
|
||||
@ -19,34 +17,34 @@ internal static partial class Helper20240429
|
||||
string[] removeRemotes = args[4].Split(',');
|
||||
string systemVolumeInformation = Path.Combine(root, args[2]);
|
||||
string[] subDirectories = Directory.GetDirectories(root, "*", SearchOption.TopDirectoryOnly);
|
||||
foreach (string subDirectory in subDirectories)
|
||||
{
|
||||
if (subDirectory == systemVolumeInformation)
|
||||
foreach (string subDirectory in subDirectories) {
|
||||
if (subDirectory == systemVolumeInformation) {
|
||||
continue;
|
||||
}
|
||||
files = Directory.GetFiles(subDirectory, searchPattern, SearchOption.AllDirectories);
|
||||
foreach (string file in files)
|
||||
{
|
||||
foreach (string file in files) {
|
||||
directory = Path.GetDirectoryName(file);
|
||||
if (directory is null)
|
||||
if (directory is null) {
|
||||
continue;
|
||||
foreach (string removeRemote in removeRemotes)
|
||||
{
|
||||
processStartInfo = new()
|
||||
{
|
||||
}
|
||||
foreach (string removeRemote in removeRemotes) {
|
||||
processStartInfo = new() {
|
||||
FileName = "git",
|
||||
WorkingDirectory = directory,
|
||||
Arguments = $"remote rm {removeRemote}",
|
||||
RedirectStandardError = true
|
||||
};
|
||||
process = Process.Start(processStartInfo);
|
||||
if (process is null)
|
||||
if (process is null) {
|
||||
continue;
|
||||
}
|
||||
#pragma warning disable IDE0058
|
||||
process.WaitForExit(7000);
|
||||
#pragma warning restore IDE0058
|
||||
standardError = process.StandardError.ReadToEnd();
|
||||
if (!standardError.Contains(ignoreError))
|
||||
if (!standardError.Contains(ignoreError)) {
|
||||
logger.LogInformation(standardError);
|
||||
}
|
||||
logger.LogInformation("for <{directoryName}> remote rm {removeRemote}", directory, removeRemote);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user