mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
upgrade wakatime-cli to v6.0.0
This commit is contained in:
@ -33,7 +33,7 @@ REV_CONTROL_PLUGINS = [
|
||||
]
|
||||
|
||||
|
||||
def get_project_info(configs, args):
|
||||
def get_project_info(configs, heartbeat):
|
||||
"""Find the current project and branch.
|
||||
|
||||
First looks for a .wakatime-project file. Second, uses the --project arg.
|
||||
@ -50,14 +50,14 @@ def get_project_info(configs, args):
|
||||
plugin_name = plugin_cls.__name__.lower()
|
||||
plugin_configs = get_configs_for_plugin(plugin_name, configs)
|
||||
|
||||
project = plugin_cls(args.entity, configs=plugin_configs)
|
||||
project = plugin_cls(heartbeat['entity'], configs=plugin_configs)
|
||||
if project.process():
|
||||
project_name = project_name or project.name()
|
||||
branch_name = project.branch()
|
||||
break
|
||||
|
||||
if project_name is None:
|
||||
project_name = args.project
|
||||
project_name = heartbeat.get('project')
|
||||
|
||||
if project_name is None or branch_name is None:
|
||||
|
||||
@ -66,14 +66,14 @@ def get_project_info(configs, args):
|
||||
plugin_name = plugin_cls.__name__.lower()
|
||||
plugin_configs = get_configs_for_plugin(plugin_name, configs)
|
||||
|
||||
project = plugin_cls(args.entity, configs=plugin_configs)
|
||||
project = plugin_cls(heartbeat['entity'], configs=plugin_configs)
|
||||
if project.process():
|
||||
project_name = project_name or project.name()
|
||||
branch_name = branch_name or project.branch()
|
||||
break
|
||||
|
||||
if project_name is None:
|
||||
project_name = args.alternate_project
|
||||
project_name = heartbeat.get('alternate_project')
|
||||
|
||||
return project_name, branch_name
|
||||
|
||||
|
Reference in New Issue
Block a user