public InitializrSettingsLoader(IEngineEnvironmentSettings environmentSettings, string hivePath)
 {
     _environmentSettings = environmentSettings;
     _paths                      = new Paths(environmentSettings);
     _userTemplateCache          = new InitializrTemplateCache(environmentSettings);
     _installUnitDescriptorCache = new InstallUnitDescriptorCache(environmentSettings);
     _hivePath                   = hivePath;
 }
Пример #2
0
 private void EnsureInstallDescriptorsLoaded()
 {
     if (!_installUnitDescriptorsLoaded)
     {
         var cacheObj = JObject.Parse(_paths.ReadAllText(_paths.User.InstallUnitDescriptorsFile, "{}"));
         _installUnitDescriptorCache   = InstallUnitDescriptorCache.FromJObject(EnvironmentSettings, cacheObj);
         _installUnitDescriptorsLoaded = true;
     }
 }
        private void EnsureInstallDescriptorsLoaded()
        {
            if (_installUnitDescriptorsLoaded)
            {
                return;
            }

            string  descriptorFileContents = _paths.ReadAllText(_paths.User.InstallUnitDescriptorsFile, "{}");
            JObject parsed = JObject.Parse(descriptorFileContents);

            _installUnitDescriptorCache   = InstallUnitDescriptorCache.FromJObject(_environmentSettings, parsed);
            _installUnitDescriptorsLoaded = true;
        }
Пример #4
0
        public TemplateSettingsLoader(IEngineEnvironmentSettings environmentSettings)
        {
            EnvironmentSettings = environmentSettings;
            _paths             = new Paths(environmentSettings);
            _userTemplateCache = new TemplateCacheEx(environmentSettings);
            //string userProfilePath = EnvironmentSettings.Environment.GetEnvironmentVariable("USERPROFILE");
            //string dotNetCliPath = Path.Combine(userProfilePath, ".templateengine", "dotnetcli");

            //string[] directories = Directory.GetDirectories(dotNetCliPath);
            //if (directories != null && directories.Length > 0)
            //{
            //    int last = directories.Length - 1;
            //    string targetDirectory = directories[last];
            //    if (_paths.Exists(targetDirectory))
            //        _userTemplateCache.Scan(targetDirectory);
            //}

            _installUnitDescriptorCache = new InstallUnitDescriptorCache(environmentSettings);
        }