bash-bastion / bash-core Goto Github PK
View Code? Open in Web Editor NEWCore functions for any Bash program.
Home Page: https://bash-bastion.github.io/bash-core/
License: Mozilla Public License 2.0
Core functions for any Bash program.
Home Page: https://bash-bastion.github.io/bash-core/
License: Mozilla Public License 2.0
With v1.0.0
coming around the corner, there are a few tasks required
Remove deprecated functions
core.init()
core.stacktrace_print()
Deprecate error handling functions
Remove error handling functions
Determine if functions like should_output_color
and get_package_info
should live here. It seems the should be somewhere else (like bash-utils
)
Override trap
and other builtins so no need to remember core functions (on flag or environment variable)
Title
Use bash-error
You could add something like an Errstacktrace
On of my projects.
(https://github.com/yoctu/yosh/blob/master/lib/cli.sh#L60)
It would look like this
/home/dzove855/yosh2/lib/marco.sh: line 4: tik: command not found Error in /home/dzove855/yosh2/lib/marco.sh:4. 'tik' exited with status 127 Call tree: 1: /home/dzove855/yosh2/lib/cli.sh:8 Marco::run(...) 2: yosh2/bin/yosh-runner.sh:78 Cli::router(...) Exiting with status 1
And then you just need to trap ERR so the stackstrace qwill always be call'd when an error happens.
This entails creating a first function for codes that require it (or all of them for consistency) and adding a global variable with $?
, since $?
will get clobbered
Error if trying to remove a function that no longer exists (or at least warning)
trap 'tty.fullscreen_deinit; exit' EXIT SIGHUP SIGABRT SIGINT SIGQUIT SIGTERM SIGTSTP
Errors that aren't operational shouldn't have the function name shown in the error output. New functions should be made for those - or as options to existing ones
Remove function names from core.print_*
(Code in ~/.dots depends on this)
Operational errors should be printed with core.panic()
. (if dying is not intended maybe there should be a --no-exit
flag
A die function should also be defined
Title. stderr for error, warn and stdout for info
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.