added delete and move functions
This commit is contained in:
parent
2913920987
commit
09cf9b8bbe
25
deploy.sh
25
deploy.sh
@ -2,6 +2,8 @@
|
||||
|
||||
SERVER=false
|
||||
FORCE=false
|
||||
DELETE=false
|
||||
MOVE=false
|
||||
|
||||
_arguments() {
|
||||
for PARM in "$@"; do
|
||||
@ -9,6 +11,10 @@ _arguments() {
|
||||
SERVER=true
|
||||
elif [ "${PARM}" = "--force" ]; then
|
||||
FORCE=true
|
||||
elif [ "${PARM}" = "--delete" ]; then
|
||||
DELETE=true
|
||||
elif [ "${PARM}" = "--move" ]; then
|
||||
MOVE=true
|
||||
elif [ "${PARM}" = "-h" ] || [ "${PARM}" = "--help" ]; then
|
||||
_help
|
||||
exit 0
|
||||
@ -24,20 +30,37 @@ _help() {
|
||||
echo " Prints this help message and quits"
|
||||
echo " --force"
|
||||
echo " Force the reinstallation of the files"
|
||||
echo " --delete"
|
||||
echo " Delete the reference in ~/.bashrc"
|
||||
echo " --move"
|
||||
echo " Create a new reference if the location of this folder has been changed"
|
||||
echo " --server"
|
||||
echo " Customizes the terminal feel for a server installation"
|
||||
echo
|
||||
}
|
||||
|
||||
_delete() {
|
||||
sed -i '/REF:bashrc_overrides:REF/{N;d}' ~/.bashrc
|
||||
}
|
||||
|
||||
_bashrc_ref() {
|
||||
echo "#REF:bashrc_overrides:REF" >> ~/.bashrc
|
||||
echo ". ${THIS}/bashrc_overrides/_all" >> ~/.bashrc
|
||||
}
|
||||
|
||||
_move() {
|
||||
_delete
|
||||
_bashrc_ref
|
||||
}
|
||||
|
||||
_main() {
|
||||
_arguments "$@"
|
||||
|
||||
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
|
||||
if [ "${DELETE}" = true ]; then
|
||||
_delete
|
||||
elif [ "${MOVE}" = true ]; then
|
||||
_move
|
||||
elif [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
|
||||
echo "bash overrides already in place"
|
||||
echo "skipping..."
|
||||
echo
|
||||
|
Loading…
Reference in New Issue
Block a user