From 563c90cb68fb9dcfa5a5816ede209a598b32a7e7 Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Tue, 23 Jul 2024 01:31:29 -0500 Subject: [PATCH] Share stock option for cmdline instance clone --- Cmdline/Action/GameInstance.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Cmdline/Action/GameInstance.cs b/Cmdline/Action/GameInstance.cs index 2690379f8..e4c208f40 100644 --- a/Cmdline/Action/GameInstance.cs +++ b/Cmdline/Action/GameInstance.cs @@ -97,6 +97,9 @@ internal class AddOptions : CommonOptions internal class CloneOptions : CommonOptions { + [Option("share-stock", DefaultValue = false, HelpText = "Use junction points (Windows) or symbolic links (Linux) for stock dirs instead of copying")] + public bool shareStock { get; set; } + [ValueOption(0)] public string nameOrPath { get; set; } [ValueOption(1)] public string new_name { get; set; } [ValueOption(2)] public string new_path { get; set; } @@ -341,7 +344,7 @@ private int CloneInstall(CloneOptions options) if (instance.Name == instanceNameOrPath) { // Found it, now clone it. - Manager.CloneInstance(instance, newName, newPath); + Manager.CloneInstance(instance, newName, newPath, options.shareStock); break; } } @@ -350,7 +353,7 @@ private int CloneInstall(CloneOptions options) // If it's valid, go on. else if (Manager.InstanceAt(instanceNameOrPath) is CKAN.GameInstance instance && instance.Valid) { - Manager.CloneInstance(instance, newName, newPath); + Manager.CloneInstance(instance, newName, newPath, options.shareStock); } // There is no instance with this name or at this path. else