-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chenlei fix the issue of StackEdge (#12069)
Co-authored-by: wyunchi-ms <[email protected]>
- Loading branch information
1 parent
6d9947a
commit 12c76b9
Showing
6 changed files
with
53 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Reflection; | ||
|
||
namespace VersionController.Utilities | ||
{ | ||
class ModuleFilter | ||
{ | ||
public static bool IsAzureStackModule(String fileName) | ||
{ | ||
bool isAzureStackModule = false; | ||
if (fileName.Contains("Stack")) | ||
{ | ||
isAzureStackModule = true; | ||
} | ||
var executingAssemblyPath = Assembly.GetExecutingAssembly().Location; | ||
var versionControllerDirectory = Directory.GetParent(executingAssemblyPath).FullName; | ||
var whiteListFile = Path.Combine(versionControllerDirectory, "WhiteList.csv"); | ||
if (File.Exists(whiteListFile)) | ||
{ | ||
var lines = File.ReadAllLines(whiteListFile).Skip(1).Where(c => !string.IsNullOrEmpty(c)); | ||
foreach (var line in lines) | ||
{ | ||
var cols = line.Split(",").Select(c => c.StartsWith("\"") ? c.Substring(1) : c) | ||
.Select(c => c.EndsWith("\"") ? c.Substring(0, c.Length - 1) : c) | ||
.Select(c => c.Trim()).ToArray(); | ||
if (cols.Length >= 1) | ||
{ | ||
if (fileName.Contains(cols[0])) | ||
{ | ||
isAzureStackModule = false; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
return isAzureStackModule; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Module | ||
StackEdge |