check if project dir already exists
							parent
							
								
									eec3c9f10a
								
							
						
					
					
						commit
						619d1f0695
					
				
							
								
								
									
										12
									
								
								install.sh
								
								
								
								
							
							
						
						
									
										12
									
								
								install.sh
								
								
								
								
							| 
						 | 
				
			
			@ -63,15 +63,21 @@ function getLibs()
 | 
			
		|||
    fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
getLibs
 | 
			
		||||
 | 
			
		||||
read -p "Enter your project name or 'exit' to quit: " newProjectName
 | 
			
		||||
if [[ $newProjectName = 'exit' || -z "$newProjectName" ]]; then
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# copy everything into new dir
 | 
			
		||||
NEW_PROJECT_DIR="$MY_DIR/../$newProjectName"
 | 
			
		||||
 | 
			
		||||
if [ -d "$NEW_PROJECT_DIR" ]; then
 | 
			
		||||
	>&2 echo "ERROR: Project directory already exists."
 | 
			
		||||
	exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
getLibs
 | 
			
		||||
 | 
			
		||||
# copy everything into new dir
 | 
			
		||||
cp -R "$MY_DIR" "$NEW_PROJECT_DIR"
 | 
			
		||||
 | 
			
		||||
cd "$NEW_PROJECT_DIR"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue