===================================================================== A follow-up to V5 focused on hardening the environment system and expanding the ZSH logging/caching toolkit. No migration required from v5.0.x, though note the log-level reorganization below may quiet some messages at lower verbosities. --- New Features ------------------------- - persistent cross-runtime cache for ZSH-type scwrypts; extends the v5.0 runtime speedup cache to survive between runs with automatic hash-based invalidation (toggle via SCWRYPTS__ZSH_CACHE_ENABLED) - new 'trace' log level (5) and echo.trace, plus '-v VARNAME' state injection for echo.debug / echo.trace to surface variable values inline - additional scwrypts output formats: 'raw' and 'logfmt' (alongside pretty and json) - normalize.boolean utility for consistent truthy/falsey handling across ZSH-type scwrypts - utils.fzf.file-select for directory-scoped file selection prompts - automatic dependency wrappers providing default arguments, GNU coreutil resolution, and scwrypts trace on wrapped commands --- Changes ------------------------------ - log levels reorganized; success / status / reminder messages now emit at level 3, so lower verbosities will show fewer of these - environment library restructured around get-user-json as the single source of truth (replaces the previous user module and cache-output) - utility renames for consistency: user.Yn / user.yN (from utils.*) - utils.fail and utils.abort deprecated in favor of echo.error and echo.error.user-abort --- Bug Fixes ---------------------------- - CI runs now resolve config lookup-paths (.dotted.path) to their environment variable before reading, fixing false "not set" reports and invalid-export errors for lookup-path checks in CI - hardened environment type detection so array-valued configs reprint correctly after their first check - corrected exit-code capture in the cache layer (now reflects the cached command, not the downstream output filter) - scwrypt exit code now survives the logging pipeline - assorted script fixes (efs unmount file listing, postgres run-sql file discovery)
30 lines
552 B
Bash
Executable File
30 lines
552 B
Bash
Executable File
#!/usr/bin/env zsh
|
|
DEPENDENCIES+=(docker)
|
|
#####################################################################
|
|
|
|
MAIN() {
|
|
local RESOURCES=(
|
|
container
|
|
image
|
|
volume
|
|
system
|
|
)
|
|
|
|
echo.warning "
|
|
this will prune the following docker resources from the
|
|
current machine:
|
|
(${RESOURCES[@]})
|
|
|
|
pruned resources are PERMANENTLY DELETED
|
|
"
|
|
|
|
user.yN 'continue?' || utils.abort
|
|
|
|
echo.success "$(
|
|
for RESOURCE in ${RESOURCES[@]}
|
|
do
|
|
echo "${RESOURCE}^:^$(docker ${RESOURCE} prune -f 2>/dev/null | tail -n 1)"
|
|
done | column -ts '^'
|
|
)"
|
|
}
|