You've already forked personal-linux-config
							
							added delete and move functions
This commit is contained in:
		
							
								
								
									
										25
									
								
								deploy.sh
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								deploy.sh
									
									
									
									
									
								
							@@ -2,6 +2,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SERVER=false
 | 
					SERVER=false
 | 
				
			||||||
FORCE=false
 | 
					FORCE=false
 | 
				
			||||||
 | 
					DELETE=false
 | 
				
			||||||
 | 
					MOVE=false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
_arguments() {
 | 
					_arguments() {
 | 
				
			||||||
  for PARM in "$@"; do
 | 
					  for PARM in "$@"; do
 | 
				
			||||||
@@ -9,6 +11,10 @@ _arguments() {
 | 
				
			|||||||
      SERVER=true
 | 
					      SERVER=true
 | 
				
			||||||
    elif [ "${PARM}" = "--force" ]; then
 | 
					    elif [ "${PARM}" = "--force" ]; then
 | 
				
			||||||
      FORCE=true
 | 
					      FORCE=true
 | 
				
			||||||
 | 
					    elif [ "${PARM}" = "--delete" ]; then
 | 
				
			||||||
 | 
					      DELETE=true
 | 
				
			||||||
 | 
					    elif [ "${PARM}" = "--move" ]; then
 | 
				
			||||||
 | 
					      MOVE=true
 | 
				
			||||||
    elif [ "${PARM}" = "-h" ] || [ "${PARM}" = "--help" ]; then
 | 
					    elif [ "${PARM}" = "-h" ] || [ "${PARM}" = "--help" ]; then
 | 
				
			||||||
      _help
 | 
					      _help
 | 
				
			||||||
      exit 0
 | 
					      exit 0
 | 
				
			||||||
@@ -24,20 +30,37 @@ _help() {
 | 
				
			|||||||
  echo "    Prints this help message and quits"
 | 
					  echo "    Prints this help message and quits"
 | 
				
			||||||
  echo "  --force"
 | 
					  echo "  --force"
 | 
				
			||||||
  echo "    Force the reinstallation of the files"
 | 
					  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 "  --server"
 | 
				
			||||||
  echo "    Customizes the terminal feel for a server installation"
 | 
					  echo "    Customizes the terminal feel for a server installation"
 | 
				
			||||||
  echo
 | 
					  echo
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					_delete() {
 | 
				
			||||||
 | 
					  sed -i '/REF:bashrc_overrides:REF/{N;d}' ~/.bashrc
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
_bashrc_ref() {
 | 
					_bashrc_ref() {
 | 
				
			||||||
  echo "#REF:bashrc_overrides:REF" >> ~/.bashrc
 | 
					  echo "#REF:bashrc_overrides:REF" >> ~/.bashrc
 | 
				
			||||||
  echo ". ${THIS}/bashrc_overrides/_all" >> ~/.bashrc
 | 
					  echo ". ${THIS}/bashrc_overrides/_all" >> ~/.bashrc
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					_move() {
 | 
				
			||||||
 | 
					  _delete
 | 
				
			||||||
 | 
					  _bashrc_ref
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
_main() {
 | 
					_main() {
 | 
				
			||||||
  _arguments "$@"
 | 
					  _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 "bash overrides already in place"
 | 
				
			||||||
    echo "skipping..."
 | 
					    echo "skipping..."
 | 
				
			||||||
    echo
 | 
					    echo
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user