def download_plugin(plugin_id, destination):
"""
Will download the specified plugin to the specified destination if it is
found in the plugin repository.
:param plugin_id: The plugin ID to download.
:type plugin_id: string
:param destination: The destination to download the plugin on disk.
:type destination: string
"""
downloadable_plugins = get_downloadable_plugins()
if plugin_id not in downloadable_plugins:
log.error('Could not find plugin in repository: %s' %plugin_id)
return
if os.path.exists(destination): shutil.rmtree(destination)
Repo.clone_from(downloadable_plugins[plugin_id]['url'], destination)
log.info('%s plugin downloaded' %plugin_id)
评论列表
文章目录