Skip to content

Commit

Permalink
Check for twine in publish.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Sep 11, 2018
1 parent 00aa815 commit 6dbb1c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ def upload_release():
myinput = input


def has_executable(exe):
for path in os.environ['PATH'].split(os.pathsep):
if os.access(os.path.join(path, exe), os.X_OK):
return True
return False


def main():
if not has_executable('twine'):
raise SystemExit('Need to install twine to upload to PyPI')
if myinput('Publish version {} [y/n]? '.format(red(VERSION))) != 'y':
raise SystemExit(1)
build_release()
Expand Down

0 comments on commit 6dbb1c5

Please sign in to comment.