refactor: lazy load os-release

This commit is contained in:
MDLeom 2023-05-20 11:23:07 +00:00
parent 667fad0b6f
commit 07ca1adfd1
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 5 additions and 2 deletions

View File

@ -13,8 +13,11 @@ alias curl="curl -L"
alias rm="rm -rf"
## Use GNU grep, busybox grep is not as performant
. "/etc/os-release"
DISTRO="$ID"
DISTRO=""
if [ -f "/etc/os-release" ]; then
. "/etc/os-release"
DISTRO="$ID"
fi
check_grep() {
if [ -z "$(grep --help | grep 'GNU')" ]; then