diff --git a/implement/PersistentProcess/PersistentProcess.WebHost/BuildConfigurationFromArguments.cs b/implement/PersistentProcess/PersistentProcess.WebHost/BuildConfigurationFromArguments.cs index f6d2866c..0912be9e 100644 --- a/implement/PersistentProcess/PersistentProcess.WebHost/BuildConfigurationFromArguments.cs +++ b/implement/PersistentProcess/PersistentProcess.WebHost/BuildConfigurationFromArguments.cs @@ -13,6 +13,8 @@ static public class BuildConfigurationFromArguments public const string ElmAppSubdirectoryName = "elm-app"; + static string StaticFilesSubdirectoryName => WebAppConfiguration.staticFilesDirectoryName; + public static IImmutableList FrontendElmAppRootFilePath => ImmutableList.Create("src", "FrontendWeb", "Main.elm"); @@ -75,11 +77,27 @@ static public (Func compileConfigZipArchive, IImmutableDictionary name, IImmutableList content)>() : new[] { (name: (IImmutableList)ImmutableList.Create(FrontendWebStaticFileName), (IImmutableList)frontendWebFile.ToImmutableList()) }; + var staticFilesSourceDirectory = Path.Combine(currentDirectory, StaticFilesSubdirectoryName); + + var staticFilesFromDirectory = + Directory.Exists(staticFilesSourceDirectory) + ? + Filesystem.GetAllFilesFromDirectory(staticFilesSourceDirectory) + .Select(nameAndContent => (name: (IImmutableList)nameAndContent.name.Split(new[] { '/', '\\' }).ToImmutableList(), content: nameAndContent.content)) + .ToImmutableList() + : + ImmutableList<(IImmutableList name, IImmutableList content)>.Empty; + + Console.WriteLine("I found " + staticFilesFromDirectory.Count + " static files to include."); + + var staticFiles = + staticFilesFromDirectory.AddRange(staticFilesFromFrontendWeb); + var webAppConfig = new WebAppConfiguration() .WithElmApp(loweredElmAppFiles) diff --git a/implement/PersistentProcess/PersistentProcess.WebHost/WebAppConfiguration.cs b/implement/PersistentProcess/PersistentProcess.WebHost/WebAppConfiguration.cs index 6aca51a2..db98b6ce 100644 --- a/implement/PersistentProcess/PersistentProcess.WebHost/WebAppConfiguration.cs +++ b/implement/PersistentProcess/PersistentProcess.WebHost/WebAppConfiguration.cs @@ -41,7 +41,7 @@ public class WebAppConfiguration static string jsonFileName => "elm-fullstack.json"; - static string staticFilesDirectoryName => "static-files"; + static public string staticFilesDirectoryName => "static-files"; static string elmAppDirectoryName => "elm-app"; diff --git a/implement/elm-fullstack/Program.cs b/implement/elm-fullstack/Program.cs index 2e1969d3..f66cd211 100644 --- a/implement/elm-fullstack/Program.cs +++ b/implement/elm-fullstack/Program.cs @@ -11,7 +11,7 @@ namespace elm_fullstack { class Program { - static string AppVersionId => "2020-04-09"; + static string AppVersionId => "2020-04-17"; static int Main(string[] args) { diff --git a/implement/elm-fullstack/elm-fullstack.csproj b/implement/elm-fullstack/elm-fullstack.csproj index ec484dbb..3791c9e5 100644 --- a/implement/elm-fullstack/elm-fullstack.csproj +++ b/implement/elm-fullstack/elm-fullstack.csproj @@ -5,8 +5,8 @@ netcoreapp3.1 elm_fullstack elm-fullstack - 2020.0409.0.0 - 2020.0409.0.0 + 2020.0417.0.0 + 2020.0417.0.0