Using prebuild.cmd so if $git$ not exist then it will create empty GitHash.txt

This commit is contained in:
Jaex 2014-06-04 22:41:24 +03:00
parent 2501ecffc0
commit 3185442111
3 changed files with 13 additions and 2 deletions

View file

@ -312,7 +312,12 @@ private static void Run(string[] args)
DebugHelper.WriteLine("Operating system: " + Environment.OSVersion.VersionString);
DebugHelper.WriteLine("Command line: " + Environment.CommandLine);
DebugHelper.WriteLine("Personal path: " + PersonalPath);
DebugHelper.WriteLine("Git: https://github.com/ShareX/ShareX/tree/" + GetGitHash());
string gitHash = GetGitHash();
if (!string.IsNullOrEmpty(gitHash))
{
DebugHelper.WriteLine("Git: https://github.com/ShareX/ShareX/tree/" + gitHash);
}
SettingsResetEvent = new ManualResetEvent(false);
UploaderSettingsResetEvent = new ManualResetEvent(false);

View file

@ -521,7 +521,7 @@
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>%25git%25 rev-parse HEAD &gt; "$(ProjectDir)GitHash.txt"</PreBuildEvent>
<PreBuildEvent>"$(ProjectDir)prebuild.cmd" "$(ProjectDir)" "GitHash.txt"</PreBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

6
ShareX/prebuild.cmd Normal file
View file

@ -0,0 +1,6 @@
cd %1
if defined git (
"%git%" rev-parse HEAD > %2
) else (
type nul > %2
)