Change bye to be a function. Add spaces to the end of some aliases. Fix indentation to consistently be tabs.
This commit is contained in:
64
bashrc.sh
64
bashrc.sh
@@ -21,11 +21,11 @@ alias shell-reload="reload-bash"
|
||||
alias reload-shell="reload-bash"
|
||||
alias reload="reload-bash"
|
||||
|
||||
alias l='ls'
|
||||
alias ll='ls -alh'
|
||||
alias lh='ls -ash'
|
||||
alias l='ls '
|
||||
alias ll='ls -alh '
|
||||
alias lh='ls -ash '
|
||||
|
||||
alias clone="rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build'"
|
||||
alias clone="rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build' "
|
||||
|
||||
# Easily get to storage devices.
|
||||
curr="`pwd`"
|
||||
@@ -60,16 +60,16 @@ alias clean-trashed='find "$SS" -name ".trashed*" -exec du -h {} \; -delete | so
|
||||
alias check-trashed='find "$SS" -name ".trashed*" -exec du -h {} \; -exec mv -v {} ~/TRASH/ \; | sort -h'
|
||||
|
||||
# Help prevent mistakes.
|
||||
alias cp="cp -v"
|
||||
alias mv="mv -v"
|
||||
alias cp="cp -v "
|
||||
alias mv="mv -v "
|
||||
alias rm="echo 'Move to ~/storage/shared/TRASH/ instead!'"
|
||||
|
||||
# Quickies
|
||||
alias bye="exit"
|
||||
alias install="pkg install"
|
||||
alias uninstall="pkg uninstall"
|
||||
alias remove="uninstall"
|
||||
alias scan="nmap -A -p- --script=vuln"
|
||||
function bye { exit; }
|
||||
alias install="pkg install "
|
||||
alias uninstall="pkg uninstall "
|
||||
alias remove="uninstall "
|
||||
alias scan="nmap -A -p- --script=vuln "
|
||||
|
||||
|
||||
### Functions ###
|
||||
@@ -140,15 +140,15 @@ alias termux-reload="reload-termux"
|
||||
# Pulled from /me/env-ansible, need to make a shared library between it and Termux.
|
||||
# Change a branch to point at another.
|
||||
function load-branch {
|
||||
rcvr="$1" # branch which we want to modify
|
||||
base="$2" # branch with the changes we want
|
||||
rcvr="$1" # branch which we want to modify
|
||||
base="$2" # branch with the changes we want
|
||||
|
||||
if [[ "$rcvr" == "main" ]]; then
|
||||
if [[ "$rcvr" == "main" ]]; then
|
||||
echo "*** ERROR: Are you nuts, fool!? Not main! Do it manually! ***"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "$base" ]]; then
|
||||
if [[ -z "$base" ]]; then
|
||||
if [[ "$rcvr" == "prod" ]]; then
|
||||
base="stage"
|
||||
elif [[ "$rcvr" == "stage" ]]; then
|
||||
@@ -158,22 +158,22 @@ function load-branch {
|
||||
return 1
|
||||
fi
|
||||
echo "* Base was not specified, using '$base' for '$rcvr'."
|
||||
else
|
||||
else
|
||||
echo "* Requested pointing '$rcvr' branch to '$base'."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "\n* Ensuring we are on base branch '$base'." &&
|
||||
git switch "$base" &&
|
||||
echo -e "\n* Changing pointer for '$rcvr' to '$base'." &&
|
||||
git branch -f "$rcvr" "$base" &&
|
||||
#echo -e "\n* Switching to branch '$rcvr'." &&
|
||||
#git switch "$rcvr" &&
|
||||
echo -e "\n* Forcing push on branch '$rcvr'." &&
|
||||
git push --force --set-upstream origin "$rcvr" &&
|
||||
echo -e "\n* Done! Displaying list of remote branches." &&
|
||||
git ls-remote --heads | sort
|
||||
echo -e "\n* Ensuring we are on base branch '$base'." &&
|
||||
git switch "$base" &&
|
||||
echo -e "\n* Changing pointer for '$rcvr' to '$base'." &&
|
||||
git branch -f "$rcvr" "$base" &&
|
||||
#echo -e "\n* Switching to branch '$rcvr'." &&
|
||||
#git switch "$rcvr" &&
|
||||
echo -e "\n* Forcing push on branch '$rcvr'." &&
|
||||
git push --force --set-upstream origin "$rcvr" &&
|
||||
echo -e "\n* Done! Displaying list of remote branches." &&
|
||||
git ls-remote --heads | sort
|
||||
|
||||
if [[ "$base" != "dev" ]]; then
|
||||
if [[ "$base" != "dev" ]]; then
|
||||
echo -e "\n* Checking if a dev branch exists."
|
||||
git ls-remote --exit-code --heads origin dev
|
||||
dev_exists="$?"
|
||||
@@ -186,10 +186,10 @@ function load-branch {
|
||||
else
|
||||
echo "*** ERROR: Unknown status for dev_exists, '$dev_exists'. ***"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "\n* Verifying which branch we're on."
|
||||
git branch
|
||||
echo -e "\n* Verifying which branch we're on."
|
||||
git branch
|
||||
}
|
||||
alias load-prod="load-branch prod"
|
||||
alias load-stage="load-branch stage"
|
||||
|
||||
Reference in New Issue
Block a user