diff --git a/code/src/Core/Locations/RemoteTemplatesLocation.cs b/code/src/Core/Locations/RemoteTemplatesLocation.cs index 311692f23..c633a3fd6 100644 --- a/code/src/Core/Locations/RemoteTemplatesLocation.cs +++ b/code/src/Core/Locations/RemoteTemplatesLocation.cs @@ -162,16 +162,6 @@ namespace Microsoft.Templates.Core.Locations } } - public static string GetVersionFromFile(string versionFilePath) - { - var version = "0.0.0"; - if (File.Exists(versionFilePath)) - { - version = File.ReadAllText(versionFilePath); - } - return version; - } - private static void SafeCleanUpTempFolder(string usedTempFolder) { try diff --git a/code/src/Core/Locations/TemplatesLocation.cs b/code/src/Core/Locations/TemplatesLocation.cs index 013fa681f..4ac772733 100644 --- a/code/src/Core/Locations/TemplatesLocation.cs +++ b/code/src/Core/Locations/TemplatesLocation.cs @@ -19,6 +19,12 @@ namespace Microsoft.Templates.Core.Locations public abstract void Adquire(string workingFolder); public abstract bool Update(string workingFolder); + public string GetVersion(string workingFolder) + { + var fileName = Path.Combine(workingFolder, Path.Combine(TemplatesName, VersionFileName)); + return GetVersionFromFile(fileName); + } + protected static void SafeDelete(string directoryPath) { if (Directory.Exists(directoryPath)) @@ -50,5 +56,15 @@ namespace Microsoft.Templates.Core.Locations CopyRecursive(directory, Path.Combine(targetDir, Path.GetFileName(directory))); } } + + protected static string GetVersionFromFile(string versionFilePath) + { + var version = "0.0.0"; + if (File.Exists(versionFilePath)) + { + version = File.ReadAllText(versionFilePath); + } + return version; + } } } diff --git a/code/src/Core/TemplatesRepository.cs b/code/src/Core/TemplatesRepository.cs index fb6c388e5..19a7360a2 100644 --- a/code/src/Core/TemplatesRepository.cs +++ b/code/src/Core/TemplatesRepository.cs @@ -52,6 +52,12 @@ namespace Microsoft.Templates.Core await AdquireContentAsync(); } } + + public string GetVersion() + { + return _location.GetVersion(WorkingFolder); + } + private async Task AdquireContentAsync() { SyncStatusChanged?.Invoke(this, SyncStatus.Adquiring); diff --git a/code/src/Wizard/Host/WizardHost.xaml b/code/src/Wizard/Host/WizardHost.xaml index fba509c45..63f6e04d3 100644 --- a/code/src/Wizard/Host/WizardHost.xaml +++ b/code/src/Wizard/Host/WizardHost.xaml @@ -39,8 +39,17 @@ - - + + + + + + + + + + +