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