1+ using System . Runtime . InteropServices ;
12using Cake . Common . Build . AzurePipelines ;
23using Xunit ;
4+ using ProcessArchitecture = System . Runtime . InteropServices . Architecture ;
35
46namespace Common . Utilities ;
57
@@ -12,6 +14,7 @@ public static IEnumerable<string> ExecuteCommand(this ICakeContext context, File
1214 {
1315 processSettings . WorkingDirectory = workDir ;
1416 }
17+
1518 context . StartProcess ( exe , processSettings , out var redirectedOutput ) ;
1619 return redirectedOutput . ToList ( ) ;
1720 }
@@ -79,6 +82,12 @@ public static string GetOS(this ICakeContext context)
7982 return string . Empty ;
8083 }
8184
85+ public static bool IsRunningOnAmd64 ( this ICakeContext _ )
86+ => RuntimeInformation . ProcessArchitecture == ProcessArchitecture . X64 ;
87+
88+ public static bool IsRunningOnArm64 ( this ICakeContext _ ) =>
89+ RuntimeInformation . ProcessArchitecture == ProcessArchitecture . Arm64 ;
90+
8291 public static string GetBuildAgent ( this ICakeContext context )
8392 {
8493 var buildSystem = context . BuildSystem ( ) ;
@@ -142,6 +151,7 @@ public static string GetBranchName(this ICakeContext context)
142151 {
143152 repositoryBranch = buildSystem . GitHubActions . Environment . Workflow . Ref . Replace ( "refs/heads/" , "" ) ;
144153 }
154+
145155 return repositoryBranch ;
146156 }
147157
@@ -161,6 +171,7 @@ public static string GetRepositoryName(this ICakeContext context)
161171 {
162172 repositoryName = buildSystem . GitHubActions . Environment . Workflow . Repository ;
163173 }
174+
164175 return repositoryName ;
165176 }
166177
@@ -172,6 +183,7 @@ public static string GetRepositoryName(this ICakeContext context)
172183 context . GetFiles ( $ "src/GitVersion.App/bin/{ Constants . DefaultConfiguration } /{ Constants . NetVersionLatest } /gitversion.dll") . SingleOrDefault ( ) ;
173184 public static FilePath ? GetGitVersionDotnetToolLocation ( this ICakeContext context ) =>
174185 context . MakeAbsolute ( Paths . Tools . Combine ( "gitversion" ) . CombineWithFilePath ( "gitversion.dll" ) ) ;
186+
175187 public static FilePath ? GetSchemaDotnetToolLocation ( this ICakeContext context ) =>
176188 context . MakeAbsolute ( Paths . Tools . Combine ( "schema" ) . CombineWithFilePath ( "schema.dll" ) ) ;
177189}
0 commit comments