Ejemplo n.º 1
0
        //private string GetGitFriendlyName(string file)
        //{
        //    var relative = GetRelativeName(file);
        //    var parts = relative.Split(System.IO.Path.DirectorySeparatorChar);
        //    return string.Join("/", parts);
        //}

        private string GetRelativeName(string file, string projectPath)
        {
            // Test if project is in NOT solution directory
            if (SolutionBaseDirectory.Replace(projectPath, "").Length == SolutionBaseDirectory.Length)
            {
                // Then lets use project to calc relative path.
                var dir = projectPath.EndsWith("\\") ? projectPath : projectPath + "\\";
                return(file.Replace(dir, ""));
            }
            else
            {
                var dir = SolutionBaseDirectory.EndsWith("\\") ? SolutionBaseDirectory : SolutionBaseDirectory + "\\";
                return(file.Replace(dir, ""));
            }
        }
Ejemplo n.º 2
0
        private string GetRelativeName(string file)
        {
            var dir = SolutionBaseDirectory.EndsWith("\\") ? SolutionBaseDirectory : SolutionBaseDirectory + "\\";

            return(file.Replace(dir, ""));
        }