# -*- coding: UTF-8 -*-
import sys
import os
from imp import reload

sys.path.insert(0, os.path.abspath('..'))
sys.path.append('/Users/ching/develop/dsite')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "../dsite.settings")
reload(sys)

import utils.lark
import git

if __name__ == '__main__':
    # def notify():
    repo = git.Repo(search_parent_directories=True)
    commit = repo.head.commit
    rev, branch = commit.name_rev.split(' ')
    msg = 'rev: %s\n\nauther: %s\n\nbranch: %s\n\nmessage: %s' % (rev, commit.author.name, branch, commit.summary)
    print(utils.lark.request({'text': msg}))
