Implement /data and /themes directories (#38)

This will allow volumes to be mounted for persistent data/themes
This commit is contained in:
2024-01-05 17:32:38 -05:00
parent 5a3d9f05f8
commit 3226f882a3
5 changed files with 21 additions and 16 deletions

View File

@@ -482,7 +482,7 @@ module Theme =
do! ThemeAssetCache.refreshTheme themeId data
TemplateCache.invalidateTheme themeId
// Save the .zip file
use file = new FileStream($"{themeId}-theme.zip", FileMode.Create)
use file = new FileStream($"./themes/{themeId}-theme.zip", FileMode.Create)
do! themeFile.CopyToAsync file
do! addMessage ctx
{ UserMessage.Success with
@@ -517,7 +517,7 @@ module Theme =
| _ ->
match! data.Theme.Delete (ThemeId themeId) with
| true ->
let zippedTheme = $"{themeId}-theme.zip"
let zippedTheme = $"./themes/{themeId}-theme.zip"
if File.Exists zippedTheme then File.Delete zippedTheme
do! addMessage ctx { UserMessage.Success with Message = $"Theme ID {themeId} deleted successfully" }
return! all next ctx