]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
src/bin/duffman: Handle errors correctly
authorAlejandro Colomar <alx@kernel.org>
Thu, 9 Jan 2025 12:32:20 +0000 (13:32 +0100)
committerAlejandro Colomar <alx@kernel.org>
Sat, 11 Jan 2025 19:00:57 +0000 (20:00 +0100)
In src/bin/duffman line 30:
cd $(git rev-parse --show-toplevel);
   ^-- SC2046 (warning): Quote this to prevent word splitting.
     ^---------------------------^ SC2312 (info): Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore).

Reported-by: shellcheck(1)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/bin/duffman

index 273758d14993a7ea1e7e1bc1ec426b0609b984de..37fe8e8209b424e1a76801ca2bb7ea2bbbc7ead2 100755 (executable)
@@ -27,7 +27,8 @@ if test $# -gt 2; then
        exit 1;
 fi;
 
-cd $(git rev-parse --show-toplevel);
+git rev-parse --show-toplevel | read -r dir;
+cd "$dir";
 
 test -v MAN_KEEP_FORMATTING || export MAN_KEEP_FORMATTING=1;