def build_static(self, *args, **options):
        """
        Builds the static files directory as well as robots.txt and favicon.ico
        """
        logger.debug("Building static directory")
        if self.verbosity > 1:
            six.print_("Building static directory")

        management.call_command(
            "collectstatic",
            interactive=False,
            verbosity=0
        )
        target_dir = os.path.join(self.build_dir, settings.STATIC_URL[1:])

        if os.path.exists(settings.STATIC_ROOT) and settings.STATIC_URL:
            if getattr(settings, 'BAKERY_GZIP', False):
                self.copytree_and_gzip(settings.STATIC_ROOT, target_dir)
            # if gzip isn't enabled, just copy the tree straight over
            else:
                shutil.copytree(settings.STATIC_ROOT, target_dir)

        # If they exist in the static directory, copy the robots.txt
        # and favicon.ico files down to the root so they will work
        # on the live website.
        robot_src = os.path.join(target_dir, 'robots.txt')
        if os.path.exists(robot_src):
            shutil.copy(robot_src, os.path.join(
                settings.BUILD_DIR,
                'robots.txt'
                )
            )

        favicon_src = os.path.join(target_dir, 'favicon.ico')
        if os.path.exists(favicon_src):
            shutil.copy(favicon_src, os.path.join(
                settings.BUILD_DIR,
                'favicon.ico',
                )
            )
dataset/ETHPy150Open datadesk/django-bakery/bakery/management/commands/build.py/Command.build_static/original