Skip to content

Commit d0de5dd

Browse files
committed
refactoring
1 parent 1a80e14 commit d0de5dd

1 file changed

Lines changed: 17 additions & 22 deletions

File tree

usr/bin/dist-installer-cli

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,25 @@ declare version me start_time dialog_title license adrelanos_signify \
6060
url_guest_file url_origin signify_key signify_signer url_domain \
6161
url_version download_flag checkhash interface_name \
6262
can_boot_virtualbox_guest_vms APTGETOPT APTGETOPT_SERIALIZED id_of_user \
63-
dist_installer_cli_was_sourced dkms_mok_path temp_folder
63+
dkms_mok_path temp_folder
6464

6565
# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/check_runtime.bsh
6666
source /usr/libexec/helper-scripts/check_runtime.bsh
6767

68-
if was_executed "${BASH_SOURCE[0]}"; then
69-
dist_installer_cli_was_sourced='false'
70-
else
71-
dist_installer_cli_was_sourced='true'
72-
fi
68+
# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/wc-test.sh
69+
source /usr/libexec/helper-scripts/wc-test.sh
7370

74-
if [ "${dist_installer_cli_was_sourced}" = 'false' ]; then
71+
# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/strings.bsh
72+
source /usr/libexec/helper-scripts/strings.bsh
73+
74+
# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/get_colors.sh
75+
source /usr/libexec/helper-scripts/get_colors.sh
76+
77+
# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/package_installed_check.sh
78+
source /usr/libexec/helper-scripts/package_installed_check.sh
79+
80+
81+
if was_executed "${BASH_SOURCE[0]}"; then
7582
## Script was executed.
7683
set -o errexit
7784
set -o errtrace
@@ -196,18 +203,6 @@ Y3B83Y34PxuSIq2kokIGo8JhqfqPB/ohtTLHg/o9RhP8xmfvALRD
196203
-----END PGP PUBLIC KEY BLOCK-----"
197204
}
198205

199-
# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/wc-test.sh
200-
source /usr/libexec/helper-scripts/wc-test.sh
201-
202-
# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/strings.bsh
203-
source /usr/libexec/helper-scripts/strings.bsh
204-
205-
# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/get_colors.sh
206-
source /usr/libexec/helper-scripts/get_colors.sh
207-
208-
# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/package_installed_check.sh
209-
source /usr/libexec/helper-scripts/package_installed_check.sh
210-
211206
########################
212207
## END DEFAULT VALUES ##
213208
########################
@@ -4623,9 +4618,9 @@ run_installer() {
46234618
}
46244619

46254620

4626-
if [ "${dist_installer_cli_was_sourced}" = 'true' ]; then
4627-
true "INFO: Not running the install script because it was sourced by another script."
4628-
else
4621+
if was_executed "${BASH_SOURCE[0]}"; then
46294622
true "INFO: Running the install script because it was executed."
46304623
run_installer "${@}"
4624+
else
4625+
true "INFO: Not running the install script because it was sourced by another script."
46314626
fi

0 commit comments

Comments
 (0)