15 Commits

Author SHA1 Message Date
Noah Gorny
eced6802d0 Merge pull request #1856 from NoahGorny/fix-typeset-command-not-found
helpers: Fix broken compoure references after vendor change
2021-03-22 21:40:29 +02:00
Noah Gorny
02f6654841 test: Add bash-it help plugins test 2021-03-21 22:07:24 +02:00
Noah Gorny
7b5f758eba helpers: Fix broken compoure references after vendor change 2021-03-21 21:52:47 +02:00
Noah Gorny
6f02b8d194 Merge pull request #1851 from ofirshtrull/master
Add support for active gcloud account in powerline prompt
2021-03-15 23:01:43 +02:00
Noah Gorny
c8ef6c9146 Merge pull request #1848 from matthewadams/master
add npm alias nt="npm test"
2021-03-13 18:55:02 +02:00
Ofir Shtrull
8ae2b1e73d fix typo 2021-03-11 18:32:10 +02:00
Ofir Shtrull
ffc1701c0a Add to prompt google gcloud active account 2021-03-11 18:25:23 +02:00
Matthew Adams
96586dd575 add alias nt="npm test" 2021-03-09 14:14:19 -06:00
Noah Gorny
c59886b8ab Merge pull request #1847 from tbhaxor/patch-2
Added alias for git rebase
2021-03-09 00:15:58 +02:00
Gurkirat Singh
5c6306deb7 alias (improvement): continue rebase after conflict resolve 2021-03-09 02:24:12 +05:30
Noah Gorny
6093ecbb60 Merge pull request #1841 from ddaza/master
fix: Git alias quote style broke functionality
2021-02-26 10:17:01 +02:00
ddaza
e289549a50 fix alias quotes 2021-02-25 19:45:59 -06:00
Artem Kovalov
9d7738d14d Improved systemd aliases
Refactor naming
Add restart
2021-02-25 00:01:38 +02:00
Noah Gorny
7827907154 Merge pull request #1838 from bialad/patch-1
Remove deprecated kubectl run --generator
2021-02-24 19:06:55 +02:00
Tobias Månsson
0ed6f045f6 Remove deprecated kubectl run --generator
It now defaults to pod, so the --generator option is not required.
2021-02-15 07:41:39 +01:00
13 changed files with 49 additions and 9 deletions

View File

@@ -84,7 +84,7 @@ alias glsum='git diff --name-only --diff-filter=U' # Show unmerged (conflicted)
alias ggui='git gui'
# home
alias ghm='cd '\''$(git rev-parse --show-toplevel)'\''' # Git home
alias ghm='cd "$(git rev-parse --show-toplevel)"' # Git home
# appendage to ghm
if ! _command_exists gh; then
alias gh='ghm'
@@ -127,6 +127,7 @@ alias grm='git rm'
# rebase
alias grb='git rebase'
alias grbc='git rebase --continue'
alias grm='git rebase master'
alias grmi='git rebase master -i'
alias gprom='git fetch origin master && git rebase origin/master && git update-ref refs/heads/master origin/master' # Rebase with latest remote master

View File

@@ -18,7 +18,7 @@ function _set_pkg_aliases()
alias kcgpan='kubectl get pods --all-namespaces'
alias kcgdan='kubectl get deployments --all-namespaces'
# launches a disposable netshoot pod in the k8s cluster
alias kcnetshoot='kubectl run --generator=run-pod/v1 netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
fi
}

View File

@@ -22,6 +22,7 @@ alias nud='npm update'
alias nr='npm run'
alias nls='npm list --depth=0 2>/dev/null'
alias nlsg='npm list -g --depth=0 2>/dev/null'
alias nt='npm test'
# npx
alias nx='npx'

View File

@@ -3,13 +3,20 @@ about-alias 'systemd service'
case $OSTYPE in
linux*)
# Improve aliases by bringing the common root `sc|scd` + `sre` for action + `u` for user
alias sc='systemctl'
alias scr='systemctl daemon-reload'
alias scu='systemctl --user'
alias scur='systemctl --user daemon-reload'
alias scdr='systemctl daemon-reload'
alias scdru='systemctl --user daemon-reload'
alias scr='systemctl restart'
alias scru='systemctl --user restart'
alias sce='systemctl stop'
alias scue='systemctl --user stop'
alias sceu='systemctl --user stop'
alias scs='systemctl start'
alias scus='systemctl --user start'
alias scsu='systemctl --user start'
# Keeping previous aliases for a non-breaking change.
alias scue='sceu'
alias scus='scsu'
alias scur='scdru'
;;
esac

View File

@@ -70,6 +70,7 @@ The contents of the prompt can be "reordered", all the "segments" (every piece o
* ``battery`` - Battery information (you'll need to enable the ``battery`` plugin)
* ``clock`` - Current time in ``HH:MM:SS`` format
* ``cwd`` - Current working directory including full folder hierarchy (c.f. ``wd``\ )
* ``gcloud`` - Current gcloud active account
* ``hostname`` - Host name of machine
* ``in_toolbox`` - Show identifier if running inside a `toolbox <https://github.com/containers/toolbox>`_
* ``in_vim`` - Show identifier if running in ``:terminal`` from vim

View File

@@ -742,14 +742,14 @@ _help-plugins()
printf '%s' 'please wait, building help...'
typeset grouplist=$(mktemp -t grouplist.XXXXXX)
typeset func
for func in $(typeset_functions)
for func in $(_typeset_functions)
do
typeset group="$(typeset -f $func | metafor group)"
if [ -z "$group" ]; then
group='misc'
fi
typeset about="$(typeset -f $func | metafor about)"
letterpress "$about" $func >> $grouplist.$group
_letterpress "$about" $func >> $grouplist.$group
echo $grouplist.$group >> $grouplist
done
# clear progress message
@@ -788,7 +788,7 @@ all_groups ()
typeset func
typeset file=$(mktemp -t composure.XXXX)
for func in $(typeset_functions)
for func in $(_typeset_functions)
do
typeset -f $func | metafor group >> $file
done

View File

@@ -69,6 +69,11 @@ function local_setup {
assert_line -n 0 ""
}
@test "helpers: bash-it help plugins" {
run bash-it help plugins
assert_line -n 1 "base:"
}
@test "helpers: bash-it help list aliases without any aliases enabled" {
run _help-list-aliases "$BASH_IT/aliases/available/ag.aliases.bash"
assert_line -n 0 "ag:"

View File

@@ -188,6 +188,12 @@ function terraform_workspace_prompt {
fi
}
function active_gcloud_account_prompt {
if _command_exists gcloud; then
echo -e "$(gcloud config list account --format "value(core.account)" 2> /dev/null)"
fi
}
function git_prompt_minimal_info {
SCM_STATE=${SCM_THEME_PROMPT_CLEAN}

View File

@@ -91,6 +91,9 @@ HISTORY_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_HISTORY_NUMBER_CHAR:="#"}
COMMAND_NUMBER_THEME_PROMPT_COLOR=${POWERLINE_COMMAND_NUMBER_COLOR:=0}
COMMAND_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_COMMAND_NUMBER_CHAR:="#"}
GCLOUD_THEME_PROMPT_COLOR=${POWERLINE_GCLOUD_COLOR:=161}
GCLOUD_CHAR=${POWERLINE_GCLOUD_CHAR:="G "}
POWERLINE_LEFT_PROMPT=${POWERLINE_LEFT_PROMPT:="scm python_venv ruby node cwd"}
POWERLINE_RIGHT_PROMPT=${POWERLINE_RIGHT_PROMPT:="in_vim clock battery user_info"}

View File

@@ -86,6 +86,9 @@ HISTORY_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_HISTORY_NUMBER_CHAR:="#"}
COMMAND_NUMBER_THEME_PROMPT_COLOR=${POWERLINE_COMMAND_NUMBER_COLOR:=254}
COMMAND_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_COMMAND_NUMBER_CHAR:="#"}
GCLOUD_THEME_PROMPT_COLOR=${POWERLINE_GCLOUD_COLOR:=161}
GCLOUD_CHAR=${POWERLINE_GCLOUD_CHAR:="G "}
POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv ruby node cwd"}
safe_append_prompt_command __powerline_prompt_command

View File

@@ -83,6 +83,9 @@ HISTORY_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_HISTORY_NUMBER_CHAR:="#"}
COMMAND_NUMBER_THEME_PROMPT_COLOR=${POWERLINE_COMMAND_NUMBER_COLOR:=0}
COMMAND_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_COMMAND_NUMBER_CHAR:="#"}
GCLOUD_THEME_PROMPT_COLOR=${POWERLINE_GCLOUD_COLOR:=161}
GCLOUD_CHAR=${POWERLINE_GCLOUD_CHAR:="G "}
POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv ruby node cwd"}
safe_append_prompt_command __powerline_prompt_command

View File

@@ -49,6 +49,13 @@ function __powerline_terraform_prompt() {
fi
}
function __powerline_gcloud_prompt() {
local active_gcloud_account=""
active_gcloud_account="$(active_gcloud_account_prompt)"
[[ -n "${active_gcloud_account}" ]] && echo "${GCLOUD_CHAR}${active_gcloud_account}|${GCLOUD_THEME_PROMPT_COLOR}"
}
function __powerline_node_prompt() {
local node_version=""

View File

@@ -88,6 +88,9 @@ HISTORY_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_HISTORY_NUMBER_CHAR:="#"}
COMMAND_NUMBER_THEME_PROMPT_COLOR=${POWERLINE_COMMAND_NUMBER_COLOR:=0}
COMMAND_NUMBER_THEME_PROMPT_CHAR=${POWERLINE_COMMAND_NUMBER_CHAR:="#"}
GCLOUD_THEME_PROMPT_COLOR=${POWERLINE_GCLOUD_COLOR:=161}
GCLOUD_CHAR=${POWERLINE_GCLOUD_CHAR:="G "}
POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv ruby node cwd"}
safe_append_prompt_command __powerline_prompt_command