Skip to content

Commit d2cf13a

Browse files
committed
optimizing check_forked check if -u is supported
Signed-off-by: alex <unc741@gmail.com>
1 parent 26ff363 commit d2cf13a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

install.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,7 @@ check_forked() {
161161
# Check for lsb_release command existence, it usually exists in forked distros
162162
if command_exists lsb_release; then
163163
# Check if the `-u` option is supported
164-
set +e
165-
lsb_release -a -u > /dev/null 2>&1
166-
lsb_release_exit_code=$?
167-
set -e
168-
169-
# Check if the command has exited successfully, it means we're in a forked distro
170-
if [ "$lsb_release_exit_code" = "0" ]; then
164+
if lsb_release -a -u > /dev/null 2>&1 ; then
171165
# Print info about current distro
172166
cat <<-EOF
173167
You're using '$lsb_dist' version '$dist_version'.

0 commit comments

Comments
 (0)