Added rbash_list
This commit is contained in:
parent
3574300184
commit
b5ada9cb6c
@ -8,6 +8,9 @@ __SCRIPT=$BASH_SOURCE
|
||||
RBASH_HOME="$HOME/.rbash"
|
||||
RBASH_SOURCES="$RBASH_HOME/sources"
|
||||
RBASH_CONFIG="$RBASH_HOME/config"
|
||||
RBASH_REMOTE="https://git.k8s.astropenguin.net"
|
||||
RBASH_REPO="penguin/utils"
|
||||
RBASH_PATH="bash/bashrc"
|
||||
|
||||
# Source global definitions
|
||||
if [ -f /etc/bashrc ]; then
|
||||
@ -107,7 +110,7 @@ function rbash_upgrade {
|
||||
local TMPFILE
|
||||
|
||||
TMPFILE=$( mktemp )
|
||||
__download "https://git.k8s.astropenguin.net/penguin/utils/raw/branch/master/bash/bashrc/rbashrc" > $TMPFILE
|
||||
__download "$RBASH_REMOTE/$RBASH_REPO/raw/branch/master/$RBASH_PATH/rbashrc" > $TMPFILE
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
MC_NAME="<MACHINE_NAME>"
|
||||
@ -142,7 +145,7 @@ function rbash_run {
|
||||
local f
|
||||
echo "Getting: $1"
|
||||
|
||||
f=`rbash_cache "https://git.k8s.astropenguin.net/penguin/utils/raw/branch/master/$1"`
|
||||
f=`rbash_cache "$RBASH_REMOTE/$RBASH_REPO/raw/branch/master/$1"`
|
||||
shift
|
||||
|
||||
"$f" "$@"
|
||||
@ -152,10 +155,20 @@ function rbash_run {
|
||||
function rbash_load {
|
||||
local f path
|
||||
echo " $1"
|
||||
f=`rbash_cache "https://git.k8s.astropenguin.net/penguin/utils/raw/branch/master/bash/bashrc/$1"`
|
||||
f=`rbash_cache "$RBASH_REMOTE/$RBASH_REPO/raw/branch/master/$RBASH_PATH/$1"`
|
||||
source "$f"
|
||||
}
|
||||
|
||||
function rbash_list {
|
||||
which jq 2>&1 > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo This command requires jq.
|
||||
return 1
|
||||
fi
|
||||
|
||||
__download "$RBASH_REMOTE/api/v1/repos/$RBASH_REPO/$RBASH_PATH/sources/" | jq -r '.[].name'
|
||||
}
|
||||
|
||||
export PS1='This is <MACHINE_NAME>\e[1;3<COLOR_CODE>m<MACHINE_COLORED_NAME>\e[0m: \w\n\$ '
|
||||
export EDITOR=vim
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user