#!/usr/bin/env php files() ->in($vendorDir . '/bitpay/php-client/src') ->exclude('Tests'); foreach ($finder as $file) { $path = $file->getRelativePathname(); $filesystem->mkdir( sprintf( '%s/lib/%s', $tmpDistDir, dirname($file->getRelativePathname()) ) ); $filesystem->copy( $file->getRealPath(), sprintf( '%s/lib/%s', $tmpDistDir, $file->getRelativePathname() ), true ); } $filesystem->mirror('app/', sprintf('%s/app/', $tmpDistDir)); $filesystem->mirror('lib/', sprintf('%s/lib/', $tmpDistDir)); $filesystem->copy('LICENSE', sprintf('%s/app/code/community/BTCpay/Core/LICENSE', $tmpDistDir)); $filesystem->copy('README.md', sprintf('%s/app/code/community/BTCpay/Core/README.md', $tmpDistDir)); // All required files are in the temp. distribution directory // Just need to tar/zip everything $filesystem->remove($distFile.'.zip'); $filesystem->remove($distFile.'.tgz'); $process = new \Symfony\Component\Process\Process( sprintf('cd %s; tar -czf %s *', $tmpDistDir, $distFile.'.tgz') ); $process->run(); $process = new \Symfony\Component\Process\Process( sprintf('cd %s; zip -r %s *', $tmpDistDir, $distFile.'.zip') ); $process->run(); // Cleanup $filesystem->remove($tmpDistDir);