From d8e466da15c6911644fc1874f05eeb02bf8de084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 17 Aug 2025 08:59:56 +0200 Subject: [PATCH] [scripts/util] add 'git' helper --- gallery_dl/version.py | 2 +- scripts/util.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gallery_dl/version.py b/gallery_dl/version.py index e6913b0b..e0aaffb6 100644 --- a/gallery_dl/version.py +++ b/gallery_dl/version.py @@ -6,5 +6,5 @@ # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. -__version__ = "1.30.4" +__version__ = "1.30.5-dev" __variant__ = None diff --git a/scripts/util.py b/scripts/util.py index fcbf8265..6d926200 100644 --- a/scripts/util.py +++ b/scripts/util.py @@ -27,6 +27,14 @@ def open(path, mode="r"): 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(): def __init__(self, path):