�&ǐk�@'bJ�h�ۊL'}T� :��'2�Z#$��n�a��� �>a��`��_3d�Qpt�/�P -��#5�,�M��� �pA:©�q�����NW��ډ�A���� �9nʺج���� �TSM��{J6?7��r�@�\����D��� �׶���s�f�TJj?"��D��`?��̒� b�#�%�C*v�$�{�$����5Ծ�F�s��y�e/8��h-�f�̰&(����Gj�L:U� 2�� ����v�_k����Y��gp,�k�WF�R������_C�R��N@���R�@�ߔ?A�w9���F("iNa-S���Q�o�3tDMLh*�#4k�T/iQ��Y*�G��m����)��8�hBm/�I�,g�ﯖ���Z��}�Cz�q@´��d.����L�ŕ�,��1�Z�܌�: ̪���F+J-'��c�tvJ8��]Q-��b��y �6;*J`r_�d ��'�G ~p��)'�C,�%F��E(��2�k�����lР�z�!�=t ��_�0��f7��� ;�p�|�U �%{DEFMOD}; GetOptionsFromArray( \@args, 'theme=s' => \$theme, 'help' => \$help, ) || usage(1); if ($help) { usage(0); } $theme ||= $default_theme; $archive = $args[0]; if ( !defined $archive ) { bail_out 'No archive given!'; } unless ( -e $archive ) { bail_out "No file found at $archive"; } my $staging_dir; my $temp_dir_obj = Cpanel::TempFile->new; if ( !-d $archive ) { # determine that the archive is in a format we can actually work with my $type = File::MMagic->new->checktype_filename($archive); unless ( $type =~ /x-g?(bzip2|tar|zip)$/ ) { bail_out "Unrecognized archive format."; } $staging_dir = $temp_dir_obj->dir( prefix => 'Cpanel-install_plugin' ); chmod 0755, $staging_dir; # extract to staging dir my $files = Cpanel::ExtractFile::extractfile( $archive, 'dir' => $staging_dir ); $staging_dir = Cpanel::Plugin::Install::determine_plugin_docroot($staging_dir); } else { # if $ARGV[0] is a directory, we'll attempt to work with that. $staging_dir = $archive; } if ( !-e "${staging_dir}/install.json" ) { print "install.json is missing from the plugin archive, cannot process\n"; POSIX::_exit(1); } POSIX::_exit(1) unless Cpanel::Plugin::Install::install_plugin( $staging_dir, $theme ); print "Plugin installed ok\n"; return; } 1;