premier update stack trace

pull/2211/head
Doraken 2023-08-02 12:51:02 +02:00
parent e38696a0ac
commit 2ff8e6c5a1
11 changed files with 91 additions and 26 deletions

View File

@ -9,4 +9,4 @@ about-alias 'the silver searcher (ag) aliases'
# -F (-F or --quit-if-one-screen) Auto exit if <1 screen # -F (-F or --quit-if-one-screen) Auto exit if <1 screen
# -X (-X or --no-init) Disable termcap init & deinit # -X (-X or --no-init) Disable termcap init & deinit
alias ag='ag --smart-case --pager="less -MIRFX"' alias ag=$("ag --smart-case --pager="less -MIRFX")

View File

@ -6,8 +6,15 @@ cite 'about-alias'
about-alias 'Apt and dpkg aliases for Ubuntu and Debian distros.' about-alias 'Apt and dpkg aliases for Ubuntu and Debian distros.'
# set apt aliases # set apt aliases
function _set_pkg_aliases() { function _set_pkg_aliases()
if _command_exists apt; then {
############ STACK_TRACE_BUILDER #####################
Function_Name="${FUNCNAME[0]}"
Function_PATH="${Function_PATH}/${Function_Name}"
######################################################
if _command_exists apt
then
alias apts='apt-cache search' alias apts='apt-cache search'
alias aptshow='apt-cache show' alias aptshow='apt-cache show'
alias aptinst='sudo apt-get install -V' alias aptinst='sudo apt-get install -V'
@ -22,6 +29,10 @@ function _set_pkg_aliases() {
alias pkgfiles='dpkg --listfiles' alias pkgfiles='dpkg --listfiles'
fi fi
############### Stack_TRACE_BUILDER ################
Function_PATH="$( dirname ${Function_PATH} )"
####################################################
} }
_set_pkg_aliases _set_pkg_aliases

View File

@ -2,8 +2,15 @@
about-alias 'Curl aliases for convenience.' about-alias 'Curl aliases for convenience.'
# set apt aliases # set apt aliases
function _set_pkg_aliases() { function _set_pkg_aliases()
if _command_exists curl; then {
############ STACK_TRACE_BUILDER #####################
Function_Name="${FUNCNAME[0]}"
Function_PATH="${Function_PATH}/${Function_Name}"
######################################################
if _command_exists curl
then
# follow redirects # follow redirects
alias cl='curl -L' alias cl='curl -L'
# follow redirects, download as original name # follow redirects, download as original name
@ -17,6 +24,10 @@ function _set_pkg_aliases() {
# see only response headers from a get request # see only response headers from a get request
alias clhead='curl -D - -so /dev/null' alias clhead='curl -D - -so /dev/null'
fi fi
############### Stack_TRACE_BUILDER ################
Function_PATH="$( dirname ${Function_PATH} )"
####################################################
} }
_set_pkg_aliases _set_pkg_aliases

View File

@ -19,7 +19,8 @@ case $OSTYPE in
;; ;;
esac esac
if _bash-it-component-item-is-enabled plugin docker; then if _bash-it-component-item-is-enabled plugin docker
then
# Function aliases from docker plugin: # Function aliases from docker plugin:
alias dkrmlc='docker-remove-most-recent-container' # Delete most recent (i.e., last) Docker container alias dkrmlc='docker-remove-most-recent-container' # Delete most recent (i.e., last) Docker container
alias dkrmall='docker-remove-stale-assets' # Delete all untagged images and exited containers alias dkrmall='docker-remove-stale-assets' # Delete all untagged images and exited containers

View File

@ -2,7 +2,8 @@
about-alias 'fuck/please to retry last command with sudo' about-alias 'fuck/please to retry last command with sudo'
# Play nicely with 'thefuck' plugin # Play nicely with 'thefuck' plugin
if ! _command_exists fuck; then if ! _command_exists fuck
then
alias fuck='sudo $(fc -ln -1)' alias fuck='sudo $(fc -ln -1)'
fi fi
alias please=fuck alias please=fuck

View File

@ -1,7 +1,8 @@
# shellcheck shell=bash # shellcheck shell=bash
about-alias 'general aliases' about-alias 'general aliases'
if command ls --color -d . &> /dev/null; then if command ls --color -d . &> /dev/null
then
alias ls='ls --color=auto' alias ls='ls --color=auto'
# BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set. # BSD `ls` doesn't need an argument (`-G`) when `$CLICOLOR` is set.
fi fi
@ -23,11 +24,13 @@ alias vbpf='${VISUAL:-vim} ~/.bash_profile'
# colored grep # colored grep
# Need to check an existing file for a pattern that will be found to ensure # Need to check an existing file for a pattern that will be found to ensure
# that the check works when on an OS that supports the color option # that the check works when on an OS that supports the color option
if command grep --color=auto "a" "${BASH_IT?}"/*.md &> /dev/null; then if command grep --color=auto "a" "${BASH_IT?}"/*.md &> /dev/null
then
alias grep='grep --color=auto' alias grep='grep --color=auto'
fi fi
if _command_exists gshuf; then if _command_exists gshuf
then
alias shuf=gshuf alias shuf=gshuf
fi fi
@ -60,7 +63,8 @@ alias -- -='cd -' # Go back
alias h='history' alias h='history'
# Tree # Tree
if ! _command_exists tree; then if ! _command_exists tree
then
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
fi fi
@ -72,14 +76,25 @@ alias rd='rmdir'
alias xt='extract' alias xt='extract'
# Display whatever file is regular file or folder # Display whatever file is regular file or folder
function catt() { function catt()
for i in "$@"; do {
if [[ -d "$i" ]]; then ############ STACK_TRACE_BUILDER #####################
Function_Name="${FUNCNAME[0]}"
Function_PATH="${Function_PATH}/${Function_Name}"
######################################################
for i in "${@}"; do
if [[ -d "$i" ]]
then
ls "$i" ls "$i"
else else
cat "$i" cat "$i"
fi fi
done done
############### Stack_TRACE_BUILDER ################
Function_PATH="$( dirname ${Function_PATH} )"
####################################################
} }
# The Bash-it aliases were moved to the `bash-it.aliases.bash` file. The intent of this # The Bash-it aliases were moved to the `bash-it.aliases.bash` file. The intent of this
@ -89,4 +104,4 @@ function catt() {
# bash-it disable alias general # bash-it disable alias general
# bash-it enable alias bash-it # bash-it enable alias bash-it
# shellcheck source-path=SCRIPTDIR # shellcheck source-path=SCRIPTDIR
source "$BASH_IT/aliases/available/bash-it.aliases.bash" source "${BASH_IT}/aliases/available/bash-it.aliases.bash"

View File

@ -91,7 +91,8 @@ alias ggui='git gui'
# home # home
alias ghm='cd "$(git rev-parse --show-toplevel)"' # Git home alias ghm='cd "$(git rev-parse --show-toplevel)"' # Git home
# appendage to ghm # appendage to ghm
if ! _command_exists gh; then if ! _command_exists gh
then
alias gh='ghm' alias gh='ghm'
fi fi
@ -199,14 +200,35 @@ case $OSTYPE in
esac esac
# functions # functions
function gdv() { function gdv()
git diff --ignore-all-space "$@" | vim -R - {
############ STACK_TRACE_BUILDER #####################
Function_Name="${FUNCNAME[0]}"
Function_PATH="${Function_PATH}/${Function_Name}"
######################################################
git diff --ignore-all-space "${@}" | vim -R -
############### Stack_TRACE_BUILDER ################
Function_PATH="$( dirname ${Function_PATH} )"
####################################################
} }
function get_default_branch() { function get_default_branch()
if git branch | grep -q '^. main\s*$'; then {
############ STACK_TRACE_BUILDER #####################
Function_Name="${FUNCNAME[0]}"
Function_PATH="${Function_PATH}/${Function_Name}"
######################################################
if git branch | grep -q '^. main\s*$'
then
echo main echo main
else else
echo master echo master
fi fi
############### Stack_TRACE_BUILDER ################
Function_PATH="$( dirname ${Function_PATH} )"
####################################################
} }

View File

@ -1,7 +1,8 @@
# shellcheck shell=bash # shellcheck shell=bash
about-alias 'kubectl aliases' about-alias 'kubectl aliases'
if _command_exists kubectl; then if _command_exists kubectl
then
alias kc='kubectl' alias kc='kubectl'
alias kcgp='kubectl get pods' alias kcgp='kubectl get pods'
alias kcgd='kubectl get deployments' alias kcgd='kubectl get deployments'

View File

@ -21,7 +21,8 @@ alias skype='open -a Skype'
alias mou='open -a Mou' alias mou='open -a Mou'
alias subl='open -a "Sublime Text"' alias subl='open -a "Sublime Text"'
if [[ -s /usr/bin/firefox ]]; then if [[ -s /usr/bin/firefox ]]
then
unalias firefox unalias firefox
fi fi

View File

@ -1,10 +1,12 @@
# shellcheck shell=bash # shellcheck shell=bash
about-alias 'uuidgen aliases' about-alias 'uuidgen aliases'
if _command_exists uuid; then # Linux if _command_exists uuid
then # Linux
alias uuidu="uuid | tr '[:lower:]' '[:upper:]'" alias uuidu="uuid | tr '[:lower:]' '[:upper:]'"
alias uuidl=uuid alias uuidl=uuid
elif _command_exists uuidgen; then # macOS/BSD elif _command_exists uuidgen
then # macOS/BSD
alias uuidu="uuidgen" alias uuidu="uuidgen"
alias uuid="uuidgen | tr '[:upper:]' '[:lower:]'" # because upper case is like YELLING alias uuid="uuidgen | tr '[:upper:]' '[:lower:]'" # because upper case is like YELLING
alias uuidl=uuid alias uuidl=uuid

View File

@ -10,5 +10,5 @@ alias vimh='vim -c ":h | only"'
# open vim in new tab is taken from # open vim in new tab is taken from
# http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek # http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek
_command_exists mvim && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; } _command_exists mvim && function mvimt { command mvim --remote-tab-silent "${@}" || command mvim "${@}"; }
_command_exists gvim && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; } _command_exists gvim && function gvimt { command gvim --remote-tab-silent "${@}" || command gvim "${@}"; }