| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function __invoke(InputInterface $input, OutputInterface $output) |
||
| 21 | { |
||
| 22 | $namespace = explode('_', $input->getArgument('namespace')); |
||
| 23 | $app = $this->container; |
||
| 24 | $scope = $input->getOption('admin') ? 'adminhtml' : 'frontend'; |
||
| 25 | |||
| 26 | $this->container->resolve(AddJs::class)->handle( |
||
| 27 | $app->get('app_dir') . '/app/code/' . $namespace[0] . '/' . $namespace[1] . '/view/' . $scope . '/requirejs-config.js', |
||
| 28 | $input->getArgument('script-name'), |
||
| 29 | $input->getArgument('namespace') . '/js/' . $input->getArgument('script-name') |
||
| 30 | ); |
||
| 31 | |||
| 32 | $this->container->resolve(CopyFile::class)->handle( |
||
| 33 | $app->get('resource_dir') . '/frontend/simple-js.js', |
||
| 34 | $app->get('app_dir') . '/app/code/' . $namespace[0] . '/' |
||
| 35 | . $namespace[1] . '/view/' . $scope . '/web/js/' . $input->getArgument('script-name') . '.js' |
||
| 36 | ); |
||
| 37 | |||
| 38 | $output->writeln('<info>' . '/app/code/' . $namespace[0] . '/' |
||
| 39 | . $namespace[1] . '/view/' . $scope . '/web/js/' . $input->getArgument('script-name') . '.js successfully generated</info>'); |
||
| 40 | } |
||
| 42 |