bin: Add 2 new scripts

Signed-off-by: Andrei Jiroh Eugenio Halili <andreijiroh@madebythepins.tk>
This commit is contained in:
Andrei Jiroh Eugenio Halili 2021-04-10 17:51:33 +08:00
parent 7bec630f67
commit 478a78222f
Signed by: ajhalili2006
GPG Key ID: A30EBE40AD856D88
2 changed files with 37 additions and 0 deletions

20
bin/history-cleanup Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
usage() {
echo "history-cleanup: Remove .*_history files from your home directory"
echo "Usage: $0 [COMMAND]"
echo "When used without any arguments, the script will assume 'all' was used."
echo
echo "WARNING: Since this script is written in Bash, there'll be no support"
echo "for other shells, considering the best-effort policy, from the"
echo "original script author"
echo "Available commands:"
echo "all Delete any history file found in home directory."
echo "bash Delete ~/.bash_history + run history -c"
echo "python"
exit
}
if [[ $@ == "" ]]; then
usage
fi

17
bin/reload-funcs-bashrc Executable file
View File

@ -0,0 +1,17 @@
#!/bin/env bash
echo "---> Refreshing custom functions..."
sleep 5
# change the path if it's different
source ~/.dotfiles/bashrc/worthwhile-functions
if [[ $? == 0 ]]; then
echo "info: Successfully refreshed functions to current session."
echo "info: Something don't work? Run edit-funcs-bashrc to edit"
echo "info: or even remove problematic functions"
else
echo "! Problems found, please run edit-funcs-bashrc to fix"
echo " and re-run this command again. In case of path changes,"
echo " please do 'source ~/.bashrc' if issue presists."
echo " If you ever moved that file, also update your ~/.bashrc and"
echo " the ~/.dotfiles/bin/reload-funcs-bashrc\#L5"
fi