Add dependency setup to v0.1.4 installer
This commit is contained in:
parent
41fc737e71
commit
c7dd6170cd
6 changed files with 67 additions and 32 deletions
|
|
@ -29,6 +29,37 @@ refresh_desktop() {
|
|||
fi
|
||||
}
|
||||
|
||||
install_dependencies() {
|
||||
if [ "${COMICVIEWER_SKIP_DEPENDENCIES:-0}" = "1" ]; then
|
||||
return
|
||||
fi
|
||||
if ! command -v pacman >/dev/null 2>&1; then
|
||||
printf '%s\n' "필수 패키지 자동 설치는 Arch Linux와 CachyOS만 지원합니다." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set --
|
||||
for package in fuse2 gtk4 dav1d gvfs gvfs-smb; do
|
||||
if ! pacman -Q "${package}" >/dev/null 2>&1; then
|
||||
set -- "$@" "${package}"
|
||||
fi
|
||||
done
|
||||
if [ "$#" -eq 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
printf '필수 패키지를 설치합니다: %s\n' "$*"
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
pacman -S --needed "$@"
|
||||
else
|
||||
if ! command -v sudo >/dev/null 2>&1; then
|
||||
printf '%s\n' "필수 패키지를 설치하려면 sudo가 필요합니다." >&2
|
||||
exit 1
|
||||
fi
|
||||
sudo pacman -S --needed "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "${1:-}" = "--uninstall" ]; then
|
||||
rm -f "${launcher}" "${installed_desktop}" "${installed_icon}" \
|
||||
"${installed_appimage}"
|
||||
|
|
@ -45,6 +76,8 @@ if [ "$#" -ne 0 ]; then
|
|||
exit 2
|
||||
fi
|
||||
|
||||
install_dependencies
|
||||
|
||||
set -- "${script_dir}"/Comicviewer-*-x86_64.AppImage
|
||||
if [ "$#" -ne 1 ] || [ ! -f "$1" ]; then
|
||||
printf '%s\n' "번들에서 Comicviewer AppImage 한 개를 찾을 수 없습니다." >&2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue