From cdd05cb3b626ea4ad7912151a6a2a4be96afa76a Mon Sep 17 00:00:00 2001 From: buhl <221842+buhl@users.noreply.github.com> Date: Fri, 10 Apr 2020 14:25:45 +0200 Subject: [PATCH] Move external libs into vendors folder Makefile to update vendors should maybe be a bash script. it is however only ment to be run by developers. Maybe vendors should be a git-subtree(1) instead Maybe we should always supply a bash-it-init.bash(or some other name) file to the vendoer forlder so we have a standardized way of loading vendor libs from bash_it.sh --- bash_it.sh | 7 +++++++ lib/preview.bash | 19 ------------------- vendors/Makefile | 14 ++++++++++++++ vendors/bash-preexec/LICENSE.md | 21 +++++++++++++++++++++ vendors/bash-preexec/URL | 1 + {lib => vendors/bash-preexec}/preexec.bash | 0 6 files changed, 43 insertions(+), 19 deletions(-) delete mode 100644 lib/preview.bash create mode 100644 vendors/Makefile create mode 100644 vendors/bash-preexec/LICENSE.md create mode 100644 vendors/bash-preexec/URL rename {lib => vendors/bash-preexec}/preexec.bash (100%) diff --git a/bash_it.sh b/bash_it.sh index a7960c75..03b9ec0b 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -49,6 +49,13 @@ do fi done +#Load external vendor libraries +# See "${BASH_IT}/vendors/Makefile for comments +for _bash_it_config_file in "${BASH_IT}/vendors/*/*.bash" +do + source "$_bash_it_config_file" +done + # Load the global "enabled" directory # "family" param is empty so that files get sources in glob order # shellcheck source=./scripts/reloader.bash diff --git a/lib/preview.bash b/lib/preview.bash deleted file mode 100644 index d0fb0623..00000000 --- a/lib/preview.bash +++ /dev/null @@ -1,19 +0,0 @@ -if [[ $BASH_PREVIEW ]]; -then - unset BASH_PREVIEW #Prevent infinite looping - echo " - - Previewing Bash-it Themes - - " - - THEMES="$BASH_IT/themes/*/*.theme.bash" - for theme in $THEMES - do - BASH_IT_THEME=${theme%.theme.bash} - BASH_IT_THEME=${BASH_IT_THEME##*/} - echo " - $BASH_IT_THEME" - echo "" | bash --init-file "${BASH_IT}/bash_it.sh" -i - done -fi diff --git a/vendors/Makefile b/vendors/Makefile new file mode 100644 index 00000000..35311315 --- /dev/null +++ b/vendors/Makefile @@ -0,0 +1,14 @@ +# Maybe this should be a bash script. +# This is however only ment to be run by developers. + +help: + @echo "make one of the following targets" + @echo + @egrep "^[0-9a-zA-Z\-]+:$$" Makefile | grep -v "help:" + +update-preexec: + # - Maybe we should make this into a git-subtree(1) instead + # - Maybe we should always supply a bash-it-init.bash file to the vendoer forlder so we have a + # standardized way of loading vendor libs from bash_it.sh + wget -q -O bash-preexec/preexec.bash https://github.com/rcaloras/bash-preexec/raw/master/bash-preexec.sh + wget -q -O bash-preexec/LICENSE.md https://github.com/rcaloras/bash-preexec/raw/master/LICENSE.md diff --git a/vendors/bash-preexec/LICENSE.md b/vendors/bash-preexec/LICENSE.md new file mode 100644 index 00000000..b4521b39 --- /dev/null +++ b/vendors/bash-preexec/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2017 Ryan Caloras and contributors (see https://github.com/rcaloras/bash-preexec) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendors/bash-preexec/URL b/vendors/bash-preexec/URL new file mode 100644 index 00000000..0f0ecb7c --- /dev/null +++ b/vendors/bash-preexec/URL @@ -0,0 +1 @@ +https://github.com/rcaloras/bash-preexec diff --git a/lib/preexec.bash b/vendors/bash-preexec/preexec.bash similarity index 100% rename from lib/preexec.bash rename to vendors/bash-preexec/preexec.bash