Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

Commit af8605d

Browse files
authored
Merge pull request #198 from thw26/master
Fix Smaller Issues
2 parents d0b23a2 + 7a3c4a1 commit af8605d

4 files changed

+56
-15
lines changed

CHANGELOG.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
# Changelog
2+
* 3.7.5
3+
- Fix #131. [T. H. Wright]
4+
- Fix #132. [T. H. Wright]
5+
- Fix #157. [T. H. Wright]
6+
- Fix #161. [T. H. Wright]
7+
- Create logos_reuse_downloads().
28
* 3.7.4
3-
- Fix #194.
9+
- Fix #194. [T. H. Wright]
410
* 3.7.3
5-
- Fix #186.
6-
- Add GUI logging at `~/.local/state/Logos_on_Linux/install.log`.
11+
- Fix #186. [T. H. Wright]
12+
- Add GUI logging at `~/.local/state/Logos_on_Linux/install.log`. [T. H. Wright]
713
* 3.7.2
8-
- Fix #178.
9-
- Make AppImage default install.
10-
- Add options to `-D|--debug`.
14+
- Fix #178. [T. H. Wright]
15+
- Make AppImage default install. [T. H. Wright]
16+
- Add options to `-D|--debug`. [T. H. Wright]
1117
* 3.7.1
1218
- Add installer `-V|--verbose`. Fix #165. [T. H. Wright]
1319
- Add installer `-k|--make_skel` and `-b|--custom-binary-path`. Resolve TODOs. Fix #166. [T. H. Wright]

Launcher-Template.sh

+15
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Options:
8787
HOME/.local/share/applications.
8888
--remove-all-index Removes all index and library catalog files.
8989
--remove-library-catalog Removes all library catalog files.
90+
--install-bash-completion Installs the bash completion file to
91+
/etc/bash_completion.d/.
9092
UEOF
9193
}
9294

@@ -329,6 +331,17 @@ SEOF
329331
echo "======= making new ${FLPRODUCT}Bible.desktop shortcut done! ======="
330332
exit 0
331333
}
334+
335+
installBashCompletion() {
336+
URL="https://raw.githubusercontent.com/ferion11/LogosLinuxInstaller/master/LogosLinuxInstaller.bash"
337+
wget -O "${HOME}/Downloads/LogosLinuxInstaller.bash" "${URL}"
338+
if [ -d "/etc/bash_completion.d" ]; then
339+
sudo mv "${HOME}/Downloads/LogosLinuxInstaller.bash" /etc/bash_completion.d/
340+
else
341+
echo "ERROR: /etc/bash_completion.d is missing."
342+
exit 1
343+
fi
344+
}
332345
# END FUNCTION DECLARATIONS
333346
# BEGIN OPTARGS
334347
RESET_OPTARGS=true
@@ -379,6 +392,8 @@ while getopts "\$OPTSTRING" opt; do
379392
removeAllIndex ;;
380393
remove-library-catalog)
381394
removeLibraryCatalog ;;
395+
install-bash-completion)
396+
installBashCompletion ;;
382397
*)
383398
if [ "\$OPTERR" = 1 ] && [ "\${OPTSTRING:0:1}" != ":" ]; then
384399
echo "\$TITLE: --\${OPTARG}: undefined option." >&2 && usage >&2 && exit

LogosLinuxInstaller.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ complete -F _logoslinuxinstaller_completions ./LogosLinuxInstaller.sh
88
complete -F _logoslinuxinstaller_completions LogosLinuxInstaller
99

1010
_logos_completions() {
11-
LOGOS_OPTIONS='-h --help -v --version -D --debbug -f --force-root -R --check-resources -e --edit-config -i --indexing -b --backup -r --restore -l --logs -d --dirlink -s --shortcut --remove-all-index --remove-library-catalog'
11+
LOGOS_OPTIONS='-h --help -v --version -D --debbug -f --force-root -R --check-resources -e --edit-config -i --indexing -b --backup -r --restore -l --logs -d --dirlink -s --shortcut --remove-all-index --remove-library-catalog --install-bash-completion'
1212
COMPREPLY=($(compgen -W "${LOGOS_OPTIONS}" -- "${COMP_WORDS[1]}"))
1313
}
1414

LogosLinuxInstaller.sh

+28-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# shellcheck disable=SC2317
33
export LOGOS_SCRIPT_TITLE="Logos Linux Installer" # From https://github.com/ferion11/LogosLinuxInstaller
44
export LOGOS_SCRIPT_AUTHOR="Ferion11, John Goodman, T. H. Wright"
5-
export LOGOS_SCRIPT_VERSION="3.7.4" # Script version for this Installer Script
5+
export LOGOS_SCRIPT_VERSION="3.7.5" # Script version for this Installer Script
66

77
#####
88
# Originally written by Ferion11.
@@ -66,6 +66,18 @@ Options:
6666
EOF
6767
}
6868

69+
die-if-running() {
70+
PIDF=/tmp/LogosLinuxInstaller.pid
71+
72+
if [ -f "${PIDF}" ]; then
73+
if logos_continue_question "The script is already running on PID $(cat "${PIDF}"). Should it be killed to allow this instance to run?" "The script is already running. Exiting." "1"; then
74+
kill -9 "$(cat "${PIDF}")"
75+
fi
76+
fi
77+
trap 'rm -f -- "${PIDF}"' EXIT
78+
echo $$ > "${PIDF}"
79+
}
80+
6981
die-if-root() {
7082
if [ "$(id -u)" -eq '0' ] && [ -z "${LOGOS_FORCE_ROOT}" ]; then
7183
logos_error "Running Wine/winetricks as root is highly discouraged. Use -f|--force-root if you must run as root. See https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F"
@@ -213,6 +225,7 @@ logos_error() {
213225
TELEGRAM_LINK="https://t.me/linux_logos"
214226
MATRIX_LINK="https://matrix.to/#/#logosbible:matrix.org"
215227
ERROR_MESSAGE="${1}"
228+
SECONDARY="${2}"
216229
HELP_MESSAGE="If you need help, please consult:\n\n${WIKI_LINK}\n${TELEGRAM_LINK}\n${MATRIX_LINK}"
217230
if [[ "${DIALOG}" == "whiptail" ]] || [[ "${DIALOG}" == "dialog" ]]; then
218231
cli_msg "${ERROR_MESSAGE}\n\n${HELP_MESSAGE}";
@@ -222,7 +235,10 @@ logos_error() {
222235
elif [[ "${DIALOG}" == "kdialog" ]]; then
223236
:
224237
fi
225-
kill -SIGKILL "-$(($(ps -o pgid= -p "${$}")))"
238+
if [ -z "${SECONDARY}" ]; then
239+
rm /tmp/LogosLinuxInstaller.pid
240+
kill -SIGKILL "-$(($(ps -o pgid= -p "${$}")))"
241+
fi
226242
exit 1;
227243
}
228244
cli_question() {
@@ -240,12 +256,13 @@ cli_question() {
240256
cli_continue_question() {
241257
QUESTION_TEXT="${1}"
242258
NO_TEXT="${2}"
243-
if ! cli_question "${1}"; then logos_error "${2}"; fi
259+
SECONDARY="${3}"
260+
if ! cli_question "${QUESTION_TEXT}"; then logos_error "${NO_TEXT}" "${SECONDARY}"; fi
244261
}
245262
cli_acknowledge_question() {
246263
QUESTION_TEXT=${1}
247264
NO_TEXT="${2}"
248-
if ! cli_question "${1}"; then logos_info "${2}"; fi
265+
if ! cli_question "${QUESTION_TEXT}"; then logos_info "${NO_TEXT}"; fi
249266
}
250267
gtk_question() {
251268
if zenity --question --width=300 --height=200 --text "$@" --title='Question:'
@@ -256,20 +273,22 @@ gtk_question() {
256273
gtk_continue_question() {
257274
QUESTION_TEXT="${1}"
258275
NO_TEXT="${2}"
259-
if ! gtk_question "$1"; then logos_error "The installation was cancelled!"; fi
276+
SECONDARY="${3}"
277+
if ! gtk_question "${QUESTION_TEXT}"; then logos_error "The installation was cancelled!" "${SECONDARY}"; fi
260278
}
261279
gtk_acknowledge_question() {
262280
QUESTION_TEXT="${1}"
263281
NO_TEXT=${2}
264-
if ! gtk_question "$1"; then logos_info "${2}"; fi
282+
if ! gtk_question "${QUESTION_TEXT}"; then logos_info "${NO_TEXT}"; fi
265283
}
266284
logos_continue_question() {
267285
QUESTION_TEXT="${1}"
268286
NO_TEXT=${2}
287+
SECONDARY="${3}"
269288
if [[ "${DIALOG}" == "whiptail" ]] || [[ "${DIALOG}" == "dialog" ]]; then
270-
cli_continue_question "${QUESTION_TEXT}" "${NO_TEXT}"
289+
cli_continue_question "${QUESTION_TEXT}" "${NO_TEXT}" "${SECONDARY}"
271290
elif [[ "${DIALOG}" == "zenity" ]]; then
272-
gtk_continue_question "${QUESTION_TEXT}" "${NO_TEXT}"
291+
gtk_continue_question "${QUESTION_TEXT}" "${NO_TEXT}" "${SECONDARY}"
273292
elif [[ "${DIALOG}" == "kdialog" ]]; then
274293
:
275294
fi
@@ -1267,6 +1286,7 @@ if [ -z "${DIALOG}" ]; then
12671286
fi
12681287
fi
12691288

1289+
die-if-running;
12701290
die-if-root;
12711291

12721292
# BEGIN OPTARGS

0 commit comments

Comments
 (0)