Exemplo n.º 1
0
 def copy_assets(self, out_format=None):
     """
     Copy assets to output directory.
     """
     if self.config.get('assets', None):
         in_assets = fs.path_for_dir(self.path, self.config['assets'])
         out_assets = self.assets_dir(out_format)
         fs.cp(in_assets, out_assets, overwrite=True)
Exemplo n.º 2
0
 def copy_resources(self, out_format=None):
     """
     Copy resources to output directory.
     """
     if self.config.get('resources', None):
         in_resources = fs.path_for_dir(self.path, self.config['resources'])
         out_resources = self.output_dir(out_format)
         fs.cp(in_resources, out_resources, overwrite=True)
Exemplo n.º 3
0
    def cmd_init(self):
        import docta

        # Test if dir is empty
        for name in os.listdir(self.current_dir()):
            if not name.startswith('.'):
                command = ' '.join((self.script_name(), self.args.command))
                exit_with_error("Current dir is not empty. Please run `%s` in empty dir." % command)

        # Copy initial project
        source_dir = fs.real(fs.dirname(docta.__file__))
        initial_dir = fs.join(source_dir, 'initial', 'default')
        fs.cp(initial_dir, self.current_dir())