#!/usr/bin/env php getMessage(); echo $e->getTraceAsString(); echo "\n\n"; $e = $e->getPrevious(); } exit(1); } /** * */ function _move_to_magento_dir(): void { $dirs = [getcwd()]; foreach ($dirs as $dir) { if (is_file($dir . '/app/bootstrap.php') && is_file($dir . '/app/etc/di.xml')) { chdir($dir); return; } } throw new \RuntimeException( 'Unable to find Magento directory. Please CD into Magento directory and then run command again.' ); } /** * */ function _create_cache_dir($dir) { if (is_dir($dir)) { return; } @mkdir($dir, 0755, true); if (!is_dir($dir)) { throw new \Exception( 'Cannot create cache dir at ' . $dir ); } } // function _output_red($m) { return "\033[31m" . $m . "\033[0m"; } // function _output_green($m) { return "\033[32m" . $m . "\033[0m"; }