From a1922ccc08db7968ce4444a27649e68804d4880c Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Tue, 4 Jun 2024 23:40:26 +0900 Subject: Init --- install.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 install.sh (limited to 'install.sh') diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..d1c902c --- /dev/null +++ b/install.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Copyright (c) 2023 Ho Kim (ho.kim@ulagbulag.io). All rights reserved. +# Use of this source code is governed by The Unlicense license that can be +# found in the LICENSE file. + +# Prehibit errors +set -e -o pipefail + +########################################################### +# Installer # +########################################################### + +function _install_local() { + # Configure + if [ "$(id -u)" = "0" ]; then + pkgdir='/usr/local' + else + pkgdir="${HOME}/.local" + fi + srcdir=$(pwd) + + # Download terms + curl -s 'https://www.kakaocorp.com/page/service/service/KakaoTalk' -o 'terms.html' + + # Local-install + install -Dm755 -t "${pkgdir}/bin" "${srcdir}/kakaotalk" + install -Dm644 -t "${pkgdir}/share/applications" "${srcdir}/kakaotalk.desktop" + install -Dm644 -t "${pkgdir}/share/icons/hicolor/256x256/apps" "${srcdir}/kakaotalk.png" + install -Dm644 -t "${pkgdir}/share/licenses/kakaotalk" "${srcdir}/terms.html" +} + +# Execute main function +_install_local "$@" || exit 1 -- cgit v1.2.3