Exemplo n.º 1
0
        private string PreparePath()
        {
            var basePath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
            if (m_dte.Solution != null)
            {
                basePath = System.IO.Path.GetDirectoryName(m_dte.Solution.FullName);
            }
            basePath = System.IO.Path.Combine(basePath, ".HistoryData");
            if (!System.IO.Directory.Exists(basePath))
            {
                var info = System.IO.Directory.CreateDirectory(basePath);
                info.Attributes |= System.IO.FileAttributes.Hidden;
            }

            // Also prepare save/build data
            var contextPath = System.IO.Path.Combine(basePath, "LocalHistory");

            if (!System.IO.Directory.Exists(contextPath))
            {
                //System.IO.Directory.CreateDirectory(contextPath);

                var provider = new GitProviderLibGit2Sharp();
                provider.Init(contextPath);
            }

            return basePath;
        }