File Permissions

This commit is contained in:
2023-06-01 18:28:58 +02:00
parent a57903cd5a
commit 8bb6fb902b
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,8 @@
using System.Text;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using static System.IO.UnixFileMode;
namespace Tranga;
@ -56,6 +58,8 @@ public readonly struct Publication
string seriesInfoPath = Path.Join(publicationFolder, "series.json");
if(!File.Exists(seriesInfoPath))
File.WriteAllText(seriesInfoPath,this.GetSeriesInfoJson());
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
File.SetUnixFileMode(seriesInfoPath, GroupRead | GroupWrite | OtherRead | OtherWrite | UserRead | UserWrite);
}
/// <returns>Serialized JSON String for series.json</returns>