Skip to content

Commit

Permalink
Share stock option for cmdline instance clone
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Jul 25, 2024
1 parent a8d9806 commit 860993d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Cmdline/Action/GameInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ internal class AddOptions : CommonOptions

internal class CloneOptions : CommonOptions
{
[Option("share-stock", DefaultValue = false, HelpText = "Use symbolic links 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; }
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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
Expand Down

0 comments on commit 860993d

Please sign in to comment.