From 3fb18391df31f333c98fafe696c48b130e685145 Mon Sep 17 00:00:00 2001 From: Paddy Xu Date: Tue, 25 Jul 2017 23:27:05 +0300 Subject: [PATCH] move cmd to ps --- QuickLook/QuickLook.csproj | 3 ++- Scripts/update-version.cmd | 10 ---------- Scripts/update-version.ps1 | 13 +++++++++++++ 3 files changed, 15 insertions(+), 11 deletions(-) delete mode 100644 Scripts/update-version.cmd create mode 100644 Scripts/update-version.ps1 diff --git a/QuickLook/QuickLook.csproj b/QuickLook/QuickLook.csproj index aa21061..a18844a 100644 --- a/QuickLook/QuickLook.csproj +++ b/QuickLook/QuickLook.csproj @@ -263,6 +263,7 @@ - "$(SolutionDir)Scripts\update-version.cmd" "$(SolutionDir)" "$(SolutionDir)GitVersion.cs" + powershell -file "$(SolutionDir)Scripts\update-version.ps1" + \ No newline at end of file diff --git a/Scripts/update-version.cmd b/Scripts/update-version.cmd deleted file mode 100644 index 3067d02..0000000 --- a/Scripts/update-version.cmd +++ /dev/null @@ -1,10 +0,0 @@ -rem @echo off -cd %1 -for /F "delims=" %%i in ('git describe --always --tags "--abbrev=0"') do set git_tag=%%i -for /F "delims=" %%i in ('git describe --always --tags') do set git_revision=%%i -echo // This file is generated by update-version.cmd > %2 -echo. >> %2 -echo using System.Reflection;>> %2 -echo. >> %2 -echo [assembly: AssemblyVersion("%git_tag%")]>> %2 -echo [assembly: AssemblyInformationalVersion("%git_revision%")]>> %2 diff --git a/Scripts/update-version.ps1 b/Scripts/update-version.ps1 new file mode 100644 index 0000000..e7e09fa --- /dev/null +++ b/Scripts/update-version.ps1 @@ -0,0 +1,13 @@ +$tag = git describe --always --tags "--abbrev=0" +$revision = git describe --always --tags + +$text = @" +// This file is generated by update-version.ps1 + +using System.Reflection; + +[assembly: AssemblyVersion("$tag")] +[assembly: AssemblyInformationalVersion("$revision")] +"@ + +$text | Out-File $PSScriptRoot\..\GitVersion.cs -Encoding utf8 \ No newline at end of file