Mulliman / xStatic-for-Umbraco

This is a static site generator built for Umbraco so that you can host simple Umbraco sites on fast and cheap hosting providers such as netlify.
42 stars 12 forks source link

Fix/linux system pathing #18

Closed adam-werner closed 2 years ago

adam-werner commented 2 years ago

This update is intended to address the recent issue that was opened #17

I've made small code updates to XStatic.Core/Generator/Storage/AppDataSiteStorer.cs and XStatic/Controllers/DownloadController.cs to resolve the issue being seen with file paths in Linux environments but continue to work within a Window environment.

The nature of the fixes has mostly come down to the Path.IsPathRooted check within the FileHelpers.PathCombine method. Within the Linux environment, full paths were being concatenated to the rooted path yielding an unexpected path several levels deeper.

The update has been tested in the following environments:

For Linux:

For Windows:

The tests consisted of taking an Umbraco 10.2.1 site with the Umbraco.TheStarterKit installed and included project references from the XStatic solution's individual projects. The xStatic.AWSS3 project was also included.

2 test static sites were created - 1 with FTP deployment and 1 with AWS S3 deployment. The projects were successfully built, deployed and downloaded in each of the environments.

The Azure App Service environments are available for review if you are interested.

Please let me know if there's any further updates that you would like to see contained within this update.

Thank you!