From 07982425e057542a78a32260066a8ab3c9a27d44 Mon Sep 17 00:00:00 2001 From: ProfessionalUwU Date: Sun, 18 Jun 2023 22:55:15 +0200 Subject: [PATCH] Write package name and version into text file --- src/Pacserver/Pacserver.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Pacserver/Pacserver.cs b/src/Pacserver/Pacserver.cs index c9d8c81..35fcbf3 100644 --- a/src/Pacserver/Pacserver.cs +++ b/src/Pacserver/Pacserver.cs @@ -66,14 +66,18 @@ public class PacserverUtils { if (!File.Exists(filePath)) { using (File.Open(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite)) { using (StreamWriter sw = new StreamWriter(filePath)) { - sw.WriteLine(""); + foreach (string package in packageNamesAndVersion) { + sw.WriteLine(package); + } } } } else if (File.Exists(filePath)) { File.Delete(filePath); using (File.Open(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite)) { using (var sw = new StreamWriter(filePath)) { - sw.WriteLine(""); + foreach (string package in packageNamesAndVersion) { + sw.WriteLine(package); + } } } }