From f5ec9cff8c7d070d20bfb7100a2f436c3b712d23 Mon Sep 17 00:00:00 2001 From: yage Date: Tue, 7 May 2024 23:17:50 -0600 Subject: [PATCH] conform scwrypts.scwrypts group definition to standard, required format; added short flag -c to make use more concise in quick non-scwrypts-runtime utility usage --- scwrypts.scwrypts.zsh | 11 +++++++++++ zsh/lib/config.group.zsh | 10 ---------- zsh/lib/config.zsh | 6 +++--- zsh/lib/import.driver.zsh | 8 ++++---- 4 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 scwrypts.scwrypts.zsh delete mode 100644 zsh/lib/config.group.zsh diff --git a/scwrypts.scwrypts.zsh b/scwrypts.scwrypts.zsh new file mode 100644 index 0000000..ab52c17 --- /dev/null +++ b/scwrypts.scwrypts.zsh @@ -0,0 +1,11 @@ +SCWRYPTS_GROUPS+=(scwrypts) + +export SCWRYPTS_ROOT__scwrypts="$SCWRYPTS_ROOT" +export SCWRYPTS_COLOR__scwrypts='\033[0;32m' +#export SCWRYPTS_TYPE__scwrypts= +#export SCWRYPTS_LIBRARY_ROOT__scwrypts= + +export SCWRYPTS_VIRTUALENV_PATH__scwrypts="$SCWRYPTS_DATA_PATH/virtualenv" + +export SCWRYPTS_PREFERRED_PYTHON_VERSIONS__scwrypts=(3.12 3.11 3.10) +export SCWRYPTS_NODE_VERSION__scwrypts=18.0.0 diff --git a/zsh/lib/config.group.zsh b/zsh/lib/config.group.zsh deleted file mode 100644 index 4f2b1b5..0000000 --- a/zsh/lib/config.group.zsh +++ /dev/null @@ -1,10 +0,0 @@ -export SCWRYPTS_ROOT__scwrypts="$SCWRYPTS_ROOT" -export SCWRYPTS_LIBRARY_ROOT__scwrypts="$SCWRYPTS_ROOT/zsh/lib" -export SCWRYPTS_COLOR__scwrypts='\033[0;32m' - - -export SCWRYPTS_VIRTUALENV_PATH__scwrypts="$SCWRYPTS_DATA_PATH/virtualenv" -[ ! -d "$SCWRYPTS_VIRTUALENV_PATH__scwrypts" ] && mkdir -p "$SCWRYPTS_VIRTUALENV_PATH__scwrypts" - -export SCWRYPTS_PREFERRED_PYTHON_VERSIONS__scwrypts=(3.11 3.10 3.9) -export SCWRYPTS_NODE_VERSION__scwrypts=18.0.0 diff --git a/zsh/lib/config.zsh b/zsh/lib/config.zsh index 2ee5092..0de3d5c 100644 --- a/zsh/lib/config.zsh +++ b/zsh/lib/config.zsh @@ -53,11 +53,11 @@ export \ SCWRYPTS_OUTPUT_PATH \ ; -SCWRYPTS_GROUPS=(scwrypts $(echo $SCWRYPTS_GROUPS | sed 's/\s\+/\n/g' | sort -u)) - -source "$SCWRYPTS_ROOT/zsh/lib/config.group.zsh" \ +source "$SCWRYPTS_ROOT/scwrypts.scwrypts.zsh" \ || FAIL 69 'failed to set up scwrypts group; aborting' +SCWRYPTS_GROUPS=(scwrypts $(echo $SCWRYPTS_GROUPS | sed 's/\s\+/\n/g' | sort -u | grep -v '^scwrypts$')) + ##################################################################### for plugin in $(ls $SCWRYPTS_ROOT__scwrypts/plugins) diff --git a/zsh/lib/import.driver.zsh b/zsh/lib/import.driver.zsh index 2d645e2..8eff2c7 100644 --- a/zsh/lib/import.driver.zsh +++ b/zsh/lib/import.driver.zsh @@ -34,7 +34,7 @@ source "${0:a:h}/config.zsh" use() { local SCWRYPTS_LIBRARY SCWRYPTS_LIBRARY_ROOT SCWRYPTS_LIBRARY_GROUP - local DEFER_ENVIRONMENT_CHECK=1 + local DEFER_ENVIRONMENT_CHECK=true while [[ $# -gt 0 ]] do @@ -49,8 +49,8 @@ use() { SCWRYPTS_LIBRARY_ROOT=$2 shift 1 ;; - --check-environment ) - DEFER_ENVIRONMENT_CHECK=0 + -c | --check-environment ) + DEFER_ENVIRONMENT_CHECK=false ;; * ) [ ! $SCWRYPTS_LIBRARY ] \ @@ -106,7 +106,7 @@ use() { return 1 } - [[ $DEFER_ENVIRONMENT_CHECK -eq 0 ]] && { + [[ $DEFER_ENVIRONMENT_CHECK =~ false ]] && { CHECK_ENVIRONMENT || { ((IMPORT_ERRORS+=1)) ERROR "import error for '$SCWRYPTS_LIBRARY_GROUP/$SCWRYPTS_LIBRARY'"