Handling Case sensitivity of Filenames when transf...
# help-with-other
c
Hey all, Transferring a site to a linux based hosting solution and very quickly learnt today about its case sensitivity 😅. As the site was originally hosted on Windows this was never a problem to have a file like Hero.cshtml and have it be referenced in code like /Views/Partials/Blocks/hero.cshtml However, now that we have the site running, its of course complaining that it cant find it. I went through, adjusted all the file names so that they match exactly whats being referenced in code, however Im not entirely sure on how to get Git (In this case, the GUI Sourcetree) to pick up filename case changes. Anyone ever dealt with this sort of thing? Cheers!
s
It's a horrible task! You have to do a
git move
https://stackoverflow.com/a/20907647/23234415 and it's a one-by-one kind of thing. 🙈
Alternatively, reference them properly in the code? So that it's actual file changes instead filename changes?
h
beat me to it Seb 🤣
c
Well I've certainly got a fun task ahead! Thanks for the SO Sebastiaan! With the code references, yeah we had a foreach looping through a blocklist and matching the alias to a filename like so:
Copy code
csharp
@foreach(var block in componentPicker)
        {
            var blockContent = block.Content;

            @Html.Partial("Components/Blocks/" + blockContent.ContentType.Alias, block)
        }
But the file names got made with capitals >.<
h
you could also capitalize blockContent.ContentType.Alias in your code
4 Views