refactor: lazy load os-release

This commit is contained in:
Ming Di Leom 2023-05-20 11:22:51 +00:00
parent 53d0e6045b
commit 4e5c38b912
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 5 additions and 2 deletions

View File

@ -14,8 +14,11 @@ alias mkdir="mkdir -p"
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