@baker.command(default=True,<EOL>shortopts={'<STR_LIT>': '<STR_LIT:c>',<EOL>'<STR_LIT>': '<STR_LIT:d>',<EOL>'<STR_LIT>': '<STR_LIT:s>',<EOL>'<STR_LIT>': '<STR_LIT:o>'})<EOL>def copy(configfile='<STR_LIT>', destpath='<STR_LIT>', overwrite=False, sub_node='<STR_LIT>'):
log.info('<STR_LIT>'.format(os.path.basename(__file__),<EOL>whoami(),<EOL>locals()))<EOL>assert(os.path.isfile(configfile))<EOL>if os.path.exists(destpath):<EOL><INDENT>if os.listdir(destpath):<EOL><INDENT>raise FolderAlreadyExists('<STR_LIT>'<EOL>'<STR_LIT>'.format(destpath))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>log.info('<STR_LIT>'.format(destpath))<EOL>path(destpath).makedirs_p()<EOL><DEDENT>from boyle.files.file_tree_map import FileTreeMap<EOL>file_map = FileTreeMap()<EOL>try:<EOL><INDENT>file_map.from_config_file(configfile)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise FileTreeMapError(str(e))<EOL><DEDENT>if sub_node:<EOL><INDENT>sub_map = file_map.get_node(sub_node)<EOL>if not sub_map:<EOL><INDENT>raise FileTreeMapError('<STR_LIT>'<EOL>'<STR_LIT>'.format(sub_node))<EOL><DEDENT>file_map._filetree = {}<EOL>file_map._filetree[sub_node] = sub_map<EOL><DEDENT>try:<EOL><INDENT>file_map.copy_to(destpath, overwrite=overwrite)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise FileTreeMapError(str(e))<EOL><DEDENT>
Copies the files in the built file tree map
    to despath.

    :param configfile: string
     Path to the FileTreeMap config file

    :param destpath: string
     Path to the files destination

    :param overwrite: bool
     Overwrite files if they already exist.

    :param sub_node: string
     Tree map configuration sub path.
     Will copy only the contents within this sub-node