Skip to content

Commit e16ab70

Browse files
authored
chore: add try/catch in release script (#479)
* Add m and try/catch in pushing * fix error message * remove -m since it does not work for this usage
1 parent 6d60774 commit e16ab70

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

script/release.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ def tag_and_generate_changelog(new_version_num):
6565

6666

6767
def upload_sdist(new_version_num):
68-
call_bash_script('twine upload "dist/Appium-Python-Client-{}.tar.gz"'.format(new_version_num))
68+
push_file = 'dist/Appium-Python-Client-{}.tar.gz'.format(new_version_num)
69+
try:
70+
call_bash_script('twine upload "{}"'.format(push_file))
71+
except Exception as e:
72+
print('Failed to upload {} to pypi. '
73+
'Please fix the original error and push it again later. Original error: {}'.format(
74+
push_file, e))
6975

7076

7177
def push_changes_to_master(new_version_num):
@@ -81,7 +87,7 @@ def ensure_publication(new_version_num):
8187
for line in sys.stdin:
8288
if line.rstrip().lower() == 'y':
8389
return
84-
exit('Canceled release pricess.')
90+
exit('Canceled release process.')
8591

8692

8793
def build_sdist():

0 commit comments

Comments
 (0)