mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-02-04 19:11:52 -08:00
fix: Git directory detection should not print an error if we are not in a git repo
This commit is contained in:
committed by
Karolin Varner
parent
b29720b0c6
commit
19fe7360d2
11
rp
11
rp
@@ -44,9 +44,14 @@ dbg() {
|
||||
}
|
||||
|
||||
|
||||
add_warning_tag() {
|
||||
detect_git_dir() {
|
||||
# https://stackoverflow.com/questions/3618078/pipe-only-stderr-through-a-filter
|
||||
("$@" 3>&1 1>&2 2>&3 3>&- | sed 's@^@WARNING: @') 3>&1 1>&2 2>&3 3>&-
|
||||
(
|
||||
git -C "${scriptdir}" rev-parse --show-toplevel 3>&1 1>&2 2>&3 3>&- \
|
||||
| sed '
|
||||
/not a git repository/d;
|
||||
s/^/WARNING: /'
|
||||
) 3>&1 1>&2 2>&3 3>&-
|
||||
}
|
||||
|
||||
# Cleanup subsystem (sigterm)
|
||||
@@ -320,7 +325,7 @@ main() {
|
||||
project_name="rosenpass"
|
||||
verbose=0
|
||||
scriptdir="$(dirname "${script}")"
|
||||
gitdir="$(add_warning_tag git -C "${scriptdir}" rev-parse --show-toplevel)" || true
|
||||
gitdir="$(detect_git_dir)" || true
|
||||
nixdir="$(readlink -f result/bin/rp | grep -Pio '^/nix/store/[^/]+(?=/bin/[^/]+)')" || true
|
||||
binary="$(find_rosenpass_binary)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user