download the database if not present
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m27s

This commit is contained in:
2025-06-09 22:54:11 +00:00
parent 80951ff41c
commit b8ba273e0e
+12
View File
@@ -2,6 +2,7 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Data.SQLite;
using System.Net;
using System.Runtime.InteropServices;
using static System.Net.Mime.MediaTypeNames;
@@ -17,6 +18,17 @@ class Program
{
SQLiteConnection sqliteconn;
if (!(File.Exists($"{FolderPath}/database.db")))
{
Console.WriteLine("Creating database.db");
using (var client = new WebClient())
{
client.DownloadFile("https://gitea.tryton.geeraert.eu//pi-ux-ce/Simpsons_generator/raw/branch/main/database.db", $"{FolderPath}/database.db");
}
}
// Create a new database connection:
var sqllitedatasource = $"Data Source={FolderPath}/database.db;Version=3;New=True;Compress=True;";
sqliteconn = new SQLiteConnection(sqllitedatasource);