-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApiUpdater.cs
More file actions
40 lines (37 loc) · 1.18 KB
/
ApiUpdater.cs
File metadata and controls
40 lines (37 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.IO;
namespace Compiler
{
public class ApiUpdater
{
public static void UpdateApi(string folderPath, Config config)
{
if (config.Updateapis)
{
if (DirectoryProcessor.IsValidDirectory(folderPath))
{
DotNetCommandExecutor.DotnetUpdateApi(folderPath, config); // Pass the config to the method.
}
}
}
public static void UpdateApiAll(Config config)
{
if (config.Updateapis)
{
string[] folders = Directory.GetDirectories(AppDomain.CurrentDomain.BaseDirectory);
if (!folders.Any())
{
Console.WriteLine("No folders found in the current directory.");
return;
}
Parallel.ForEach(folders, folder =>
{
if (DirectoryProcessor.IsValidDirectory(folder))
{
DotNetCommandExecutor.DotnetUpdateApi(folder, config); // Pass the config to the method.
}
});
}
}
}
}