v5.0.0
=====================================================================
Excited to bring V5 to life. This includes some BREAKING CHANGES to
several aspects of ZSH-type scwrypts. Please refer to the readme
for upgrade details (specifically docs/upgrade/v4-to-v5.md)
--- New Features -------------------------
- ZSH testing library with basic mock capabilities
- new scwrypts environment file format includes metadata and more
advanced features like optional parent env overrides, selection
inheritence, and improved structurual flexibility
- speedup cache for non-CI runs of ZSH-type scwrypts
- ${scwryptsmodule} syntax now allows a consistent unique-naming
scheme for functions in ZSH-type scwrypts while providing better
insight into origin of API calls in other modules
- reusable, case-statement-driven argument parsers in ZSH-type scwrypts
--- Changes ------------------------------
- several utility function renames in ZSH-type scwrypts to improve
consistency
- documentation comments included in ZSH libraries
- ZSH-type scwrypts now allow library modules to live alongside
executables
(zsh/lib still supported; autodetection determines default)
--- Bug Fixes ----------------------------
- hardened environment checking for REQUIRED_ENV variables; this removes
the ability to overwrite variables in local function contexts
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#####################################################################
|
||||
|
||||
SCWRYPTS_NOTIFICATION_ENGINES+=(${scwryptsmodule})
|
||||
|
||||
${scwryptsmodule}.success() { notify.desktop echo.success $@; }
|
||||
${scwryptsmodule}.error() { notify.desktop echo.error $@; }
|
||||
${scwryptsmodule}.reminder() { notify.desktop echo.reminder $@; }
|
||||
${scwryptsmodule}.status() { notify.desktop echo.status $@; }
|
||||
${scwryptsmodule}.warning() { notify.desktop echo.warning $@; }
|
||||
${scwryptsmodule}.debug() { notify.desktop echo.debug $@; }
|
||||
|
||||
${scwryptsmodule}() {
|
||||
local MESSAGE="$($1 --stdout ${@:2} | utils.colors.remove)"
|
||||
[ "${MESSAGE}" ] && utils.notify-send "${MESSAGE}"
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#
|
||||
# send notifications from the command line
|
||||
#
|
||||
|
||||
SCWRYPTS_NOTIFICATION_ENGINES=(echo)
|
||||
#
|
||||
# a "notification engine" implements all the .methods in the first block
|
||||
# of ../utils/io/20-echo.zsh (e.g. "echo.success")
|
||||
#
|
||||
# using 'echo' as a notification engine will print the message to the
|
||||
# console as well
|
||||
#
|
||||
# overwrite this variable if you only want to notify a subset of engines
|
||||
# e.g. :
|
||||
# local SCWRYPTS_NOTIFICATION_ENGINES=(echo desktop)
|
||||
#
|
||||
|
||||
# notify-send integration
|
||||
use notify/desktop
|
||||
|
||||
#####################################################################
|
||||
|
||||
${scwryptsmodule}() { # notify all available methods
|
||||
local ENGINE
|
||||
for ENGINE in ${SCWRYPTS_NOTIFICATION_ENGINES[@]}
|
||||
do
|
||||
${ENGINE}.${1} ${@:2}
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
${scwryptsmodule}.success() { notify success $@; }
|
||||
${scwryptsmodule}.error() { notify error $@; return 1; }
|
||||
${scwryptsmodule}.reminder() { notify reminder $@; }
|
||||
${scwryptsmodule}.status() { notify status $@; }
|
||||
${scwryptsmodule}.warning() { notify warning $@; }
|
||||
${scwryptsmodule}.debug() { notify debug $@; }
|
||||
Reference in New Issue
Block a user