From 94499a2f026a9f64c582617f2e12d5251dbd0ff7 Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 8 Feb 2021 21:04:09 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=88=F0=9F=8F=A0=E2=9D=97=20Well=20I=20?= =?UTF-8?q?did=20things=20-=20Hopefully=20nothing=20breaks=20=E2=9D=97?= =?UTF-8?q?=F0=9F=8F=A0=F0=9F=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 112 ++++++++++++++++++---------------------------------- version.txt | 2 +- 2 files changed, 39 insertions(+), 75 deletions(-) diff --git a/install.sh b/install.sh index fa72d89..2bacaa6 100755 --- a/install.sh +++ b/install.sh @@ -1,121 +1,85 @@ #!/usr/bin/env bash - +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - APPNAME="MesloLGSNF" USER="${SUDO_USER:-${USER}}" HOME="${USER_HOME:-${HOME}}" +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +#set opts # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# @Author : Jason -# @Contact : casjaysdev@casjay.net -# @File : install.sh -# @Created : Fr, Aug 28, 2020, 00:00 EST -# @License : WTFPL -# @Copyright : Copyright (c) CasjaysDev -# @Description : installer script for MesloLGSNF font -# +##@Version : 020820212056-git +# @Author : Jason Hempstead +# @Contact : jason@casjaysdev.com +# @License : WTFPL.md +# @ReadME : README.md +# @Copyright : Copyright: (c) 2021 Jason Hempstead, CasjaysDev +# @Created : Monday, Feb 08, 2021 20:56 EST +# @File : install.sh +# @Description : MesloLGSNF fonts +# @TODO : +# @Other : +# @Resource : # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Set functions - -SCRIPTSFUNCTURL="${SCRIPTSAPPFUNCTURL:-https://github.com/casjay-dotfiles/scripts/raw/master/functions}" -SCRIPTSFUNCTDIR="${SCRIPTSAPPFUNCTDIR:-/usr/local/share/CasjaysDev/scripts}" +# Import functions +CASJAYSDEVDIR="${CASJAYSDEVDIR:-/usr/local/share/CasjaysDev/scripts}" +SCRIPTSFUNCTDIR="${CASJAYSDEVDIR:-/usr/local/share/CasjaysDev/scripts}/functions" SCRIPTSFUNCTFILE="${SCRIPTSAPPFUNCTFILE:-app-installer.bash}" - +SCRIPTSFUNCTURL="${SCRIPTSAPPFUNCTURL:-https://github.com/dfmgr/installer/raw/master/functions}" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -if [ -f "$SCRIPTSFUNCTDIR/functions/$SCRIPTSFUNCTFILE" ]; then - . "$SCRIPTSFUNCTDIR/functions/$SCRIPTSFUNCTFILE" -elif [ -f "$HOME/.local/share/CasjaysDev/functions/$SCRIPTSFUNCTFILE" ]; then - . "$HOME/.local/share/CasjaysDev/functions/$SCRIPTSFUNCTFILE" +if [ -f "$PWD/$SCRIPTSFUNCTFILE" ]; then + . "$PWD/$SCRIPTSFUNCTFILE" +elif [ -f "$SCRIPTSFUNCTDIR/$SCRIPTSFUNCTFILE" ]; then + . "$SCRIPTSFUNCTDIR/$SCRIPTSFUNCTFILE" else - curl -LSs "$SCRIPTSFUNCTURL/$SCRIPTSFUNCTFILE" -o "/tmp/$SCRIPTSFUNCTFILE" || exit 1 - . "/tmp/$SCRIPTSFUNCTFILE" + echo "Can not load the functions file: $SCRIPTSFUNCTDIR/$SCRIPTSFUNCTFILE" 1>&2 + exit 1 fi - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Call the main function system_installdirs - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Make sure the scripts repo is installed - scripts_check - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Defaults APPNAME="${APPNAME:-MesloLGSNF}" APPDIR="${APPDIR:-$SHARE/CasjaysDev/fontmgr}/$APPNAME" +INSTDIR="${APPDIR}" REPO="${FONTMGRREPO:-https://github.com/fontmgr}/${APPNAME}" REPORAW="${REPORAW:-$REPO/raw}" APPVERSION="$(__appversion "$REPORAW/master/version.txt")" - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# dfmgr_install fontmgr_install iconmgr_install pkmgr_install systemmgr_install thememgr_install wallpapermgr_install - +# Call the fontmgr function fontmgr_install - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Script options IE: --help - show_optvars "$@" - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# end with a space - -APP="" - -# install packages - useful for package that have the same name on all oses -install_packages $APP - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Ensure directories exist - ensure_dirs ensure_perms - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Main progam - -if [ -d "$APPDIR/.git" ]; then - execute \ - "git_update $APPDIR" \ - "Updating $APPNAME configurations" -else - execute \ - "git_clone -q $REPO/$APPNAME $APPDIR" \ - "Installing $APPNAME configurations" +if __am_i_online; then + if [ -d "$INSTDIR/.git" ]; then + execute "git_update $INSTDIR" "Updating $APPNAME font package" + else + execute "git_clone $REPO/$APPNAME $INSTDIR" "Installing $APPNAME font package" + fi + # exit on fail + failexitcode $? "Git has failed" fi - -# exit on fail -failexitcode - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # run post install scripts - run_postinst() { fontmgr_run_post } - -execute \ - "run_postinst" \ - "Running post install scripts" - +# +execute "run_postinst" "Running post install scripts" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # create version file - fontmgr_install_version - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # exit run_exit - # end diff --git a/version.txt b/version.txt index fe60e70..ac9148a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -020820211604-git +020820212104-git