[scripts/util] add 'git' helper
This commit is contained in:
@@ -6,5 +6,5 @@
|
|||||||
# it under the terms of the GNU General Public License version 2 as
|
# it under the terms of the GNU General Public License version 2 as
|
||||||
# published by the Free Software Foundation.
|
# published by the Free Software Foundation.
|
||||||
|
|
||||||
__version__ = "1.30.4"
|
__version__ = "1.30.5-dev"
|
||||||
__variant__ = None
|
__variant__ = None
|
||||||
|
|||||||
@@ -27,6 +27,14 @@ def open(path, mode="r"):
|
|||||||
return builtins.open(path, mode, encoding="utf-8", newline="\n")
|
return builtins.open(path, mode, encoding="utf-8", newline="\n")
|
||||||
|
|
||||||
|
|
||||||
|
def git(command, *args):
|
||||||
|
import subprocess
|
||||||
|
return subprocess.Popen(
|
||||||
|
["git", command, *args],
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
).communicate()[0].strip().decode()
|
||||||
|
|
||||||
|
|
||||||
class lazy():
|
class lazy():
|
||||||
|
|
||||||
def __init__(self, path):
|
def __init__(self, path):
|
||||||
|
|||||||
Reference in New Issue
Block a user