diff --git a/librz/util/str.c b/librz/util/str.c index 1842ac3b27..6285e2c28b 100644 --- a/librz/util/str.c +++ b/librz/util/str.c @@ -4067,6 +4067,7 @@ RZ_API char *rz_str_version(const char *program) { if (!gittip || !*rz_str_trim_head_ro(gittip)) { goto done; } + rz_str_trim(gittip); rz_strbuf_append(sb, "\n"); rz_strbuf_appendf(sb, "commit: %s", gittip); done: diff --git a/meson.build b/meson.build index 9954ecb879..6aa8d3d098 100644 --- a/meson.build +++ b/meson.build @@ -540,6 +540,7 @@ if git_exe.found() and fs.exists('.git') build_by_default: true, output: 'gittip', command: [py3_exe, git_exe_repo_py, git_exe, repo, 'rev-parse', 'HEAD'], + capture: true, install: true, install_dir: rizin_bindir ) diff --git a/sys/meson_git_wrapper.py b/sys/meson_git_wrapper.py index 304dcf7a1b..8e73a7fdad 100755 --- a/sys/meson_git_wrapper.py +++ b/sys/meson_git_wrapper.py @@ -25,9 +25,7 @@ def isCArgSupported(executable, path): def simple_git_execution(args): try: - called = subprocess.run(args, check=True, capture_output=True) - with open("gittip", "w", encoding="utf8") as f: - f.write(called.stdout.decode("utf8").strip()) + called = subprocess.run(args, check=True) sys.exit(called.returncode) except subprocess.CalledProcessError as e: sys.exit(e.returncode)