download the database if not present
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m27s
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 1m27s
This commit is contained in:
+12
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user