mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Using prebuild.cmd so if $git$ not exist then it will create empty GitHash.txt
This commit is contained in:
parent
2501ecffc0
commit
3185442111
3 changed files with 13 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -521,7 +521,7 @@
|
|||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>%25git%25 rev-parse HEAD > "$(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
6
ShareX/prebuild.cmd
Normal file
|
@ -0,0 +1,6 @@
|
|||
cd %1
|
||||
if defined git (
|
||||
"%git%" rev-parse HEAD > %2
|
||||
) else (
|
||||
type nul > %2
|
||||
)
|
Loading…
Reference in a new issue