Skip to content

Commit

Permalink
CA improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
devedse committed Apr 20, 2018
1 parent b6730fe commit c4bcf5a
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 55 deletions.
44 changes: 22 additions & 22 deletions WebOptimizationProject/Helpers/RelativeGitPathHelper.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
namespace WebOptimizationProject.Helpers
{
public static class RelativeGitPathHelper
{
public static string GetRelativeGitPath(string clonedRepoPath, string fullFilePath, string branchName)
{
clonedRepoPath = clonedRepoPath.Replace('\\', '/');
clonedRepoPath = clonedRepoPath.TrimEnd('/');

fullFilePath = fullFilePath.Replace('\\', '/');

if (!fullFilePath.ToUpperInvariant().StartsWith(clonedRepoPath.ToUpperInvariant()))
{
return null;
}

string relativePath = fullFilePath.Substring(clonedRepoPath.Length);
string retval = $"../blob/{branchName}{relativePath}";
return retval;
}
}
}
namespace WebOptimizationProject.Helpers
{
public static class RelativeGitPathHelper
{
public static string GetRelativeGitPath(string clonedRepoPath, string fullFilePath, string branchName)
{
clonedRepoPath = clonedRepoPath.Replace('\\', '/');
clonedRepoPath = clonedRepoPath.TrimEnd('/');

fullFilePath = fullFilePath.Replace('\\', '/');

if (!fullFilePath.StartsWith(clonedRepoPath, System.StringComparison.OrdinalIgnoreCase))
{
return null;
}

string relativePath = fullFilePath.Substring(clonedRepoPath.Length);
string retval = $"../blob/{branchName}{relativePath}";
return retval;
}
}
}
66 changes: 33 additions & 33 deletions WebOptimizationProject/WebOptimizationProject.csproj
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>1.0.0.0</Version>
<Title>WebOptimizationProject</Title>
<Authors>Devedse</Authors>
<Description>The Library around DeveImageOptimizer to optimize GitHub repositories</Description>
<PackageProjectUrl>https://github.com/devedse/WebOptimizationProject</PackageProjectUrl>
<PackageTags>image;optimization;github</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DeveImageOptimizer" Version="1.0.163" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Octokit" Version="0.28.0" />
</ItemGroup>

<ItemGroup>
<None Update="CommitInPullRequestMarkdownTemplate.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="CommitMarkdownTemplate.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="PullRequestMarkdownTemplate.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>1.0.0.0</Version>
<Title>WebOptimizationProject</Title>
<Authors>Devedse</Authors>
<Description>The Library around DeveImageOptimizer to optimize GitHub repositories</Description>
<PackageProjectUrl>https://github.com/devedse/WebOptimizationProject</PackageProjectUrl>
<PackageTags>image;optimization;github</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DeveImageOptimizer" Version="1.0.163" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Octokit" Version="0.28.0" />
</ItemGroup>

<ItemGroup>
<None Update="CommitInPullRequestMarkdownTemplate.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="CommitMarkdownTemplate.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="PullRequestMarkdownTemplate.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>

0 comments on commit c4bcf5a

Please sign in to comment.