Skip to content

Commit d8af993

Browse files
committed
Allow manually overriding lsb_dist from outside the script.
1 parent e9faf4d commit d8af993

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

install.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ check_forked() {
188188
EOF
189189

190190
# Get the upstream release info
191-
lsb_dist=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'id' | cut -d ':' -f 2 | tr -d '[:space:]')
191+
if [ -z ${lsb_dist} ]; then
192+
lsb_dist=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'id' | cut -d ':' -f 2 | tr -d '[:space:]')
193+
fi
192194
dist_version=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'codename' | cut -d ':' -f 2 | tr -d '[:space:]')
193195

194196
# Print info about upstream distro
@@ -301,7 +303,9 @@ do_install() {
301303
fi
302304

303305
# perform some very rudimentary platform detection
304-
lsb_dist=$( get_distribution )
306+
if [ -z ${lsb_dist} ]; then
307+
lsb_dist=$( get_distribution )
308+
fi
305309
lsb_dist="$(echo "$lsb_dist" | tr '[:upper:]' '[:lower:]')"
306310

307311
if is_wsl; then

0 commit comments

Comments
 (0)