| 
									
										
										
										
											2017-11-20 13:17:24 -08:00
										 |  |  | #!/bin/bash | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | main() { | 
					
						
							|  |  |  |   local version=$1 | 
					
						
							|  |  |  |   if [[ -z "${version}" ]]; then | 
					
						
							|  |  |  |     echo "USAGE: $0 1.3.2" | 
					
						
							|  |  |  |     echo "Provide a new version number as an argument to bump the version" | 
					
						
							|  |  |  |     echo -n "Current:" | 
					
						
							|  |  |  |     grep version= setup.py | 
					
						
							|  |  |  |     return 1 | 
					
						
							|  |  |  |   fi | 
					
						
							| 
									
										
										
										
											2017-12-27 11:06:26 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   # TODO: replace this with the bumpversion pip package, I couldn't | 
					
						
							|  |  |  |   # figure out how to use that for these files | 
					
						
							| 
									
										
										
										
											2017-11-20 13:17:24 -08:00
										 |  |  |   sed -i '' "s/version=.*$/version='${version}',/g" setup.py | 
					
						
							| 
									
										
										
										
											2017-12-27 11:06:26 -08:00
										 |  |  |   sed -i '' "s/__version__ = .*$/__version__ = '${version}',/g" moto/__init__.py | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-20 13:17:24 -08:00
										 |  |  |   git checkout -b version-${version} | 
					
						
							|  |  |  |   # Commit the new version | 
					
						
							| 
									
										
										
										
											2017-12-27 11:08:09 -08:00
										 |  |  |   git commit setup.py moto/__init__.py -m "bumping to version ${version}" | 
					
						
							| 
									
										
										
										
											2017-11-20 13:17:24 -08:00
										 |  |  |   # Commit an updated IMPLEMENTATION_COVERAGE.md | 
					
						
							|  |  |  |   make implementation_coverage || true | 
					
						
							|  |  |  |   # Open a PR | 
					
						
							|  |  |  |   open https://github.com/spulec/moto/compare/master...version-${version} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | main $@ |