File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -682,7 +682,7 @@ func (c *CLI) pkgCopyCmd() *cobra.Command {
682
682
c .Error (err )
683
683
return
684
684
}
685
- targetInstance , err := determineContentTargetInstance (cmd , c .aem .InstanceManager ())
685
+ targetInstance , err := determineTargetInstance (cmd , c .aem .InstanceManager ())
686
686
if err != nil {
687
687
c .Error (err )
688
688
return
@@ -727,3 +727,19 @@ func (c *CLI) pkgCopyCmd() *cobra.Command {
727
727
cmd .Flags ().BoolP ("force" , "f" , false , "Copy even when already copied" )
728
728
return cmd
729
729
}
730
+
731
+ func determineTargetInstance (cmd * cobra.Command , instanceManager * pkg.InstanceManager ) (* pkg.Instance , error ) {
732
+ var instance * pkg.Instance
733
+ url , _ := cmd .Flags ().GetString ("instance-target-url" )
734
+ if url != "" {
735
+ instance , _ = instanceManager .NewByIDAndURL ("remote_adhoc_target" , url )
736
+ }
737
+ id , _ := cmd .Flags ().GetString ("instance-target-id" )
738
+ if id != "" {
739
+ instance = instanceManager .NewByID (id )
740
+ }
741
+ if instance == nil {
742
+ return nil , fmt .Errorf ("missing 'instance-target-url' or 'instance-target-id'" )
743
+ }
744
+ return instance , nil
745
+ }
You can’t perform that action at this time.
0 commit comments