Dashboard - git config 설정
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import json, requests, os
|
||||
import os, json, requests, subprocess
|
||||
from git import Repo
|
||||
|
||||
repo = Repo('.')
|
||||
@@ -27,16 +27,16 @@ def get_user_name_list():
|
||||
users = ['', 'dsk-minchulahn', 'Ose-Exem', 'deukjin', 'pparkssi3']
|
||||
return users
|
||||
|
||||
def get_user_email(name):
|
||||
if name == 'dsk-minchulahn': return 'minchulahn@ex-em.com'
|
||||
elif name == 'Ose-Exem': return 'ose@ex-em.com'
|
||||
elif name == 'deukjin': return 'djkim@ex-em.com'
|
||||
elif name == 'pparkssi3': return 'pparkssi@ex-em.com'
|
||||
def get_user_email(username):
|
||||
if username == 'dsk-minchulahn': return 'minchulahn@ex-em.com'
|
||||
elif username == 'Ose-Exem': return 'ose@ex-em.com'
|
||||
elif username == 'deukjin': return 'djkim@ex-em.com'
|
||||
elif username == 'pparkssi3': return 'pparkssi@ex-em.com'
|
||||
else: return ''
|
||||
|
||||
def set_git_config(name, email):
|
||||
repo.config_writer().set_value('user', 'name', name).release()
|
||||
repo.config_writer().set_value('user', 'email', email).release()
|
||||
def set_git_config(username, email):
|
||||
subprocess.run(["git", "config", "--global", "user.name", username], check=True)
|
||||
subprocess.run(["git", "config", "--global", "user.email", email], check=True)
|
||||
|
||||
def diff():
|
||||
if len(repo.index.diff(repo.head.commit)) > 0:
|
||||
|
||||
Reference in New Issue
Block a user