Esempio n. 1
0
        public static void LoadConfig(TargetSite target, string webroot)
        {
            string configFile = Path.Combine(Helper.GetTargetRootDir(target.Root, webroot), Constants.ConfigFileName);

            if (!File.Exists(configFile))
            {
                target.HasLoadedConfig = true;
                target.Config = new TargetConfig();
                return;
            }

            target.Config = File.ReadAllText(configFile).FromJson<TargetConfig>();
        }
Esempio n. 2
0
        public static void SetTemplateFileOfTarget(TargetSite target, string rootDir, string webRoot)
        {
            string tmp = Path.Combine(rootDir, Constants.LayoutFolderName);

            target.HasCustomLayout = Directory.Exists(tmp);

            if (target.HasCustomLayout)
            {
                target.TemplateFile = Path.Combine(tmp, Constants.MasterFileName);
            }
            else
            {
                target.TemplateFile = Path.Combine(webRoot, Constants.LayoutFolderName, Constants.MasterFileName);
            }
        }