#!/usr/bin/env bash# shellcheck source=/dev/nullsource ../init
source"${LIBBASH_DIR}/git"function check_git(){if lb_git_available;thenprintf"git is available\n"elseprintf"git is not available\n"fi}function check_in_repo(){if lb_in_git_repo;then# shellcheck disable=SC2016printf'$(pwd) is in a repo\n'else# shellcheck disable=SC2016printf'$(pwd) is not in a repo\n'fi}function main(){ check_git
check_in_repo
s=$(lb_repo_root)printf"repo_root: %s\n""${s}"}main "${@}"
#!/usr/bin/env bash: "${LIBBASH_DIR:?LIBBASH_DIR must be set. Please source libbash/init before other libraries.}"#------------------------------ Global Variables ------------------------------#------------------------------ Private Functions -----------------------------#------------------------------ Public Functions ------------------------------function lb_git_available(){# shellcheck disable=SC2016command -v git &>/dev/null || lb_fail 'Git binary not found in ${PATH}'}function lb_in_git_repo(){ lb_git_available
git status >/dev/null || lb_fail "$(pwd) is not within a git repo."}# Get the top level of a git repofunction lb_repo_root(){ lb_in_git_repo
git rev-parse --show-toplevel
}
#!/usr/bin/env bash# shellcheck source=/dev/nullsource ../init
source"${LIBBASH_DIR}/git"function check_git(){if lb_git_available;thenprintf"git is available\n"elseprintf"git is not available\n"fi}function check_in_repo(){if lb_in_git_repo;then# shellcheck disable=SC2016printf'$(pwd) is in a repo\n'else# shellcheck disable=SC2016printf'$(pwd) is not in a repo\n'fi}function main(){ check_git
check_in_repo
s=$(lb_repo_root)printf"repo_root: %s\n""${s}"}main "${@}"
#!/usr/bin/env bash: "${LIBBASH_DIR:?LIBBASH_DIR must be set. Please source libbash/init before other libraries.}"#------------------------------ Global Variables ------------------------------#------------------------------ Private Functions -----------------------------#------------------------------ Public Functions ------------------------------function lb_git_available(){# shellcheck disable=SC2016command -v git &>/dev/null || lb_fail 'Git binary not found in ${PATH}'}function lb_in_git_repo(){ lb_git_available
git status >/dev/null || lb_fail "$(pwd) is not within a git repo."}# Get the top level of a git repofunction lb_repo_root(){ lb_in_git_repo
git rev-parse --show-toplevel
}
#!/usr/bin/env bash# shellcheck source=/dev/nullsource ../init
source"${LIBBASH_DIR}/git"function check_git(){if lb_git_available;thenprintf"git is available\n"elseprintf"git is not available\n"fi}function check_in_repo(){if lb_in_git_repo;then# shellcheck disable=SC2016printf'$(pwd) is in a repo\n'else# shellcheck disable=SC2016printf'$(pwd) is not in a repo\n'fi}function main(){ check_git
check_in_repo
s=$(lb_repo_root)printf"repo_root: %s\n""${s}"}main "${@}"
#!/usr/bin/env bash: "${LIBBASH_DIR:?LIBBASH_DIR must be set. Please source libbash/init before other libraries.}"#------------------------------ Global Variables ------------------------------#------------------------------ Private Functions -----------------------------#------------------------------ Public Functions ------------------------------function lb_git_available(){# shellcheck disable=SC2016command -v git &>/dev/null || lb_fail 'Git binary not found in ${PATH}'}function lb_in_git_repo(){ lb_git_available
git status >/dev/null || lb_fail "$(pwd) is not within a git repo."}# Get the top level of a git repofunction lb_repo_root(){ lb_in_git_repo
git rev-parse --show-toplevel
}