Created
April 24, 2018 14:49
-
-
Save flagbug/593f2969e9c40f9afb2c60d07de1ae58 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Task("Version") | |
.Does(() => | |
{ | |
IEnumerable<string> redirectedStandardOutput; | |
IEnumerable<string> redirectedErrorOutput; | |
var exitCodeWithArgument = | |
StartProcess( | |
"git", | |
new ProcessSettings { | |
Arguments = "rev-parse HEAD", | |
RedirectStandardOutput = true | |
}, | |
out redirectedStandardOutput, | |
out redirectedErrorOutput | |
); | |
string gitCommitHash = redirectedStandardOutput.Single(); | |
ReplaceTextInFiles("path_to_your_appsettings", "%BUILD_COMMIT_HASH%", gitCommitHash); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment