Compare commits

...
2 Commits
Author SHA1 Message Date
me 8ead4b4e6d bashrc, add explicit () to functions. 2026-09-29 07:52:58 -07:00
me 5b6f1a5b64 bashrc, change functions to have underscore names. 2026-09-29 07:48:20 -07:00
+21 -19
View File
@@ -664,7 +664,7 @@
done
'
function_code_reseed: |
function git_projects_to_sync {
function git_projects_to_sync() {
# Projects should be followed by the current development branch name.
cat <<- EOF
env-ansible dev
@@ -694,7 +694,7 @@
nomadic-weather.wiki main
EOF
}
function code-seed {
function code_seed() {
# Git repo information.
git_repo_ssh={{ git_repo_ssh }}
git_main_project={{ git_project }}
@@ -721,15 +721,17 @@
fi
done
}
function code-reseed {
alias code-seed="code_seed "
function code_reseed() {
# Unseed current projects.
echo -e "\n*** Move old projects to TRASH ***"
unseed_dir="$HOME/TRASH/`date +%Y%m%d_%H%M%S`_UnseededCodeProjects"
mkdir -pv "$unseed_dir"
mv -v $HOME/Code/* "$unseed_dir"/ 2>/dev/null
code-seed
code_seed
}
alias code-reseed="code_reseed "
function_clean_filenames: |
function clean-filenames() {
# Must provide the directory you'd like to clean all the filenames in.
@@ -784,7 +786,7 @@
alias_prod: |
alias prod="ssh -p {{ prod_port }} {{ prod_user }}@{{ prod_host }}"
function_clean_code: |
function clean-code {
function clean-code() {
echo -e "******* Android *******\n*** Build Caches ***"
find $HOME/Code/android-*/app -maxdepth 1 -type d -name "build" \
-exec du -hs {} \; -exec rm -rf {} \;
@@ -820,7 +822,7 @@
alias system-killer="kill-system"
function_update_sdks: |
if [[ "$workstation" == "true" && "$coding" == "true" ]]; then
function update-sdks {
function update-sdks() {
echo -e "******* Update SDKs *******\n*** Android - START ***"
yes | sdkmanager --update
yes | sdkmanager --licenses
@@ -838,7 +840,7 @@
alias sdk-updater="update-sdks"
fi
function_ansible_vars: |
function ansible-var-list {
function ansible-var-list() {
cat << EOF
provision
battery
@@ -851,7 +853,7 @@
domain
EOF
}
function ansible-vars {
function ansible-vars() {
ansible-var-list | while read var; do
echo "$var = ${!var}"
done
@@ -869,7 +871,7 @@
alias ansible-facts='ansible localhost -m setup --connection=local'
function_backup: |
export BACKUP_DIR="/srv/backup"
function backup {
function backup() {
/usr/local/bin/backup_system.sh
}
alias backup-system="backup"
@@ -882,7 +884,7 @@
function_pull_prod_backups: |
export DOCKER="Docker"
export SYSTEM="System"
function pull_prod_backup {
function pull_prod_backup() {
if [[ -z "$1" || ("$1" != "$DOCKER" && "$1" != "$SYSTEM") ]]; then
echo "ERROR: Parameter 1 not correct, expecting '$DOCKER' or '$SYSTEM'."
return 1
@@ -910,7 +912,7 @@
mv tmp $HOME/TRASH/"tmp_`now`"
fi
}
function pull_prod_backups {
function pull_prod_backups() {
dir="ProductionBackups-Pulled`today`"
mkdir -pv "$dir"
cd "$dir"
@@ -933,7 +935,7 @@
alias pull-prod="pull_prod_backups"
alias prod-pull="pull_prod_backups"
function_debian_upgrade: |
function debian-upgrade {
function debian-upgrade() {
typeset -l OLD NEW
OLD="$1"
NEW="$2"
@@ -1004,7 +1006,7 @@
alias upgrade-debian="debian-upgrade"
function_ebook_convert: |
# Regenerate all eBook projects at once.
function ebook-convert {
function ebook-convert() {
find $HOME/Code/ebook-* -name "*.pdf" -print -delete
find $HOME/Code/ebook-* -name convert.sh -print -exec bash "{}" \;
}
@@ -1015,7 +1017,7 @@
alias sudo="sudo "
function_load_branch: |
# Change a branch to point at another.
function load-branch {
function load-branch() {
rcvr="$1" # branch which we want to modify
base="$2" # branch with the changes we want
@@ -1107,10 +1109,10 @@
alias_flatpak_clean: |
alias flatpak-clean="flatpak uninstall --unused"
alias_commit: |
function commit_usage {
function commit_usage() {
echo 'Usage: commit "This is a commit message"'
}
function commit {
function commit() {
if [[ -z "$1" ]]; then
echo "ERROR: Message must be provided."
commit_usage
@@ -1128,7 +1130,7 @@
return "$status"
}
function_loop: |
function loop {
function loop() {
cmd="$1"
while true; do
$cmd
@@ -1149,7 +1151,7 @@
sh -c "rm '{{ notify_log_file_wip }}'"
fi
function_reconnect: |
function reconnect {
function reconnect() {
test_domain="git.hyperling.com"
test_connection() {
ping -c 3 $test_domain
@@ -1212,7 +1214,7 @@
alias fix_connections="reconnect"
function_reset_android_studio: |
# Useful after Android Studio is closed improperly. Resets all settings.
function reset_android_studio {
function reset_android_studio() {
mv -v ~/.var/app/com.google.AndroidStudio ~/TRASH/com.google.AndroidStudio-`date +"%Y%m%d"`
}
alias reset-android-studio="reset_android_studio "