@@ -14,8 +14,8 @@ protected function configure()
1414 {
1515 $ this ->setName ('node:clone ' );
1616 $ this ->setDescription ('Copy a node from one workspace to another ' );
17- $ this ->addArgument ('srcAbsPath ' , InputArgument::REQUIRED , 'Absolute path to source node ' );
18- $ this ->addArgument ('destAbsPath ' , InputArgument::REQUIRED , 'Absolute path to destination node ' );
17+ $ this ->addArgument ('srcPath ' , InputArgument::REQUIRED , 'Path to source node ' );
18+ $ this ->addArgument ('destPath ' , InputArgument::REQUIRED , 'Path to destination node ' );
1919 $ this ->addArgument ('srcWorkspace ' , InputArgument::OPTIONAL , 'If specified, copy from this workspace ' );
2020 $ this ->addOption ('remove-existing ' , null , InputOption::VALUE_NONE , 'Remove existing nodes ' );
2121 $ this ->setHelp (<<<HERE
@@ -58,12 +58,16 @@ public function execute(InputInterface $input, OutputInterface $output)
5858 {
5959 $ session = $ this ->getHelper ('phpcr ' )->getSession ();
6060 $ srcWorkspace = $ input ->getArgument ('srcWorkspace ' );
61- $ srcAbsPath = $ input ->getArgument ('srcAbsPath ' );
62- $ destAbsPath = $ input ->getArgument ('destAbsPath ' );
61+ $ srcAbsPath = $ session -> getAbsPath ( $ input ->getArgument ('srcPath ' ) );
62+ $ destAbsPath = $ session -> getAbsPath ( $ input ->getArgument ('destPath ' ) );
6363 $ removeExisting = $ input ->getOption ('remove-existing ' );
6464
6565 // todo: Check to ensure that source node has the referenceable mixin
6666
67+ if (!$ srcWorkspace ) {
68+ $ srcWorkspace = $ session ->getWorkspace ()->getName ();
69+ }
70+
6771 $ workspace = $ session ->getWorkspace ();
6872 $ workspace ->cloneFrom ($ srcWorkspace , $ srcAbsPath , $ destAbsPath , $ removeExisting );
6973 }
0 commit comments