From: Lady Date: Sun, 5 Apr 2026 20:04:14 +0000 (-0400) Subject: Use command to find the default Git location X-Git-Tag: 0.1.2^0 X-Git-Url: https://git.ladys.computer/HOMEDIR/commitdiff_plain/cbd4c39660ff21f6bacb9dcca90bca6225833ffcce161f413703c4d64f126f70 Use command to find the default Git location This is better than presuming a specific install location, which probably varies by platform. Message-type: text/lesml --- diff --git a/sh/git.sh b/sh/git.sh index f6dc5e9..aef6cc0 100755 --- a/sh/git.sh +++ b/sh/git.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# @(#)🏠📂 HOMEDIR sh/git.sh 2026-04-05T19:34:02Z +# @(#)🏠📂 HOMEDIR sh/git.sh 2026-04-05T20:04:14Z # SPDX-FileCopyrightText: 2026 Lady # SPDX-License-Identifier: MPL-2.0 @@ -43,8 +43,13 @@ set -o 'errexit' ## ## As this script is expected to override `git´ in the `${PATH}´, the ## actual path to the Git binary must be used. +## Assuming Git is in the usual location, this can be found with +## `command -pv git´. -: "${cmd_GIT:=/usr/bin/git}" +defaultgit="$( + command -pv git +)" +: "${cmd_GIT:=${defaultgit}}" : "${cmd_MKDIR:=mkdir}" : "${cmd_PRINTF:=printf}" : "${cmd_PWD:=pwd}"