зеркало из https://github.com/microsoft/Atlas.git
Fix bug with https blueprint provider (#79)
* Fix bug with https blueprint provider * System.IO.Path methods would encode `/` characters * Also re-order to try shorter paths first, to reduce the number of NotFound responses * Need dot in extension
This commit is contained in:
Родитель
c7e218e6e4
Коммит
750a91e542
|
@ -0,0 +1 @@
|
|||
Subproject commit baa81416330fbb712ad9f39d2e997ba8afbbb13b
|
|
@ -38,25 +38,24 @@ namespace Microsoft.Atlas.CommandLine.Templates.FileSystems
|
|||
|
||||
private IEnumerable<string> WithoutPartialsFolder(string filePath)
|
||||
{
|
||||
yield return filePath;
|
||||
|
||||
const string partials = "partials/";
|
||||
if (filePath.StartsWith(partials, StringComparison.Ordinal))
|
||||
const string PartialsFolder = "partials/";
|
||||
if (filePath.StartsWith(PartialsFolder, StringComparison.Ordinal))
|
||||
{
|
||||
yield return filePath.Substring(partials.Length);
|
||||
yield return filePath.Substring(PartialsFolder.Length);
|
||||
}
|
||||
|
||||
yield return filePath;
|
||||
}
|
||||
|
||||
private IEnumerable<string> WithoutExtension(string filePath)
|
||||
{
|
||||
yield return filePath;
|
||||
|
||||
if (Path.GetExtension(filePath) == ".hbs")
|
||||
const string HbsExtension = ".hbs";
|
||||
if (filePath.EndsWith(HbsExtension))
|
||||
{
|
||||
yield return Path.Combine(
|
||||
Path.GetDirectoryName(filePath),
|
||||
Path.GetFileNameWithoutExtension(filePath));
|
||||
yield return filePath.Substring(0, filePath.Length - HbsExtension.Length);
|
||||
}
|
||||
|
||||
yield return filePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче