Merge pull request #5240 from sbwalker/dev

backup parameter needs to be backward compatible
This commit is contained in:
Shaun Walker 2025-04-10 12:27:39 -04:00 committed by GitHub
commit 1ff8ec78c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,19 +15,25 @@ namespace Oqtane.Updater
/// <param name="args"></param> /// <param name="args"></param>
static void Main(string[] args) static void Main(string[] args)
{ {
// requires 3 arguments - the ContentRootPath, the WebRootPath of the site, and a backup flag // note additional arguments must be added in a backward compatible manner as older versions will not pass them
// requires 2 arguments - the ContentRootPath and the WebRootPath of the site
// for testing purposes you can uncomment and modify the logic below // for testing purposes you can uncomment and modify the logic below
//Array.Resize(ref args, 3); //Array.Resize(ref args, 3);
//args[0] = @"C:\yourpath\oqtane.framework\Oqtane.Server"; //args[0] = @"C:\yourpath\oqtane.framework\Oqtane.Server";
//args[1] = @"C:\yourpath\oqtane.framework\Oqtane.Server\wwwroot"; //args[1] = @"C:\yourpath\oqtane.framework\Oqtane.Server\wwwroot";
//args[2] = @"true"; //args[2] = @"true"; // parameter added in 6.1.2
if (args.Length == 3) if (args.Length >= 2)
{ {
string contentrootfolder = args[0]; string contentrootfolder = args[0];
string webrootfolder = args[1]; string webrootfolder = args[1];
bool backup = bool.Parse(args[2]);
bool backup = true;
if (args.Length >= 3)
{
backup = bool.Parse(args[2]);
}
string deployfolder = Path.Combine(contentrootfolder, "Packages"); string deployfolder = Path.Combine(contentrootfolder, "Packages");
string backupfolder = Path.Combine(contentrootfolder, "Backup"); string backupfolder = Path.Combine(contentrootfolder, "Backup");