From 3c81c2ba412f5d8b9e0d0cb11df60fe3125d2ea2 Mon Sep 17 00:00:00 2001 From: Matt Pannella Date: Sun, 18 Sep 2022 18:05:25 -0400 Subject: [PATCH] optional parameter for settings file --- Updater.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Updater.cs b/Updater.cs index 39663921..22135ea4 100644 --- a/Updater.cs +++ b/Updater.cs @@ -47,7 +47,7 @@ public class PocketCoreUpdater /// /// The directory to install/update openFPGA cores in. /// Path to cores json file - public PocketCoreUpdater(string updateDirectory, string coresFile = null) + public PocketCoreUpdater(string updateDirectory, string coresFile = null, string settingsPath = null) { UpdateDirectory = updateDirectory; @@ -61,7 +61,11 @@ public PocketCoreUpdater(string updateDirectory, string coresFile = null) } LoadCores(); - SettingsFile = Path.Combine(updateDirectory, "pocket_updater_settings.json"); + if(settingsPath != null) { + SettingsFile = Path.Combine(settingsPath, "pocket_updater_settings.json"); + } else { + SettingsFile = Path.Combine(updateDirectory, "pocket_updater_settings.json"); + } LoadSettings(); }