summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorChris Jerdonek <chris.jerdonek@gmail.com>2012-05-06 17:53:39 -0700
committerChris Jerdonek <chris.jerdonek@gmail.com>2012-05-06 17:53:39 -0700
commit783e07a8c5100b9956d5c2c77f5b70e6f7021cbc (patch)
treed928b067bb2c92e728c0cf23c89ea57942670ef8 /setup.py
parent07dcd48752456ec1bb4ad87b17c877e71a19d503 (diff)
downloadpystache-783e07a8c5100b9956d5c2c77f5b70e6f7021cbc.tar.gz
Added user confirmation to publish script.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index dfe125f..607c716 100644
--- a/setup.py
+++ b/setup.py
@@ -114,6 +114,11 @@ def publish():
Publish this package to PyPI (aka "the Cheeseshop").
"""
+ answer = raw_input("Are you sure (yes/no)?")
+
+ if answer != "yes":
+ exit("Aborted: nothing published")
+
os.system('python setup.py sdist upload')
@@ -132,10 +137,6 @@ License
return '\n\n'.join(sections)
-if sys.argv[-1] == 'publish':
- publish()
- sys.exit()
-
# We follow the guidance here for compatibility with using setuptools instead
# of Distribute under Python 2 (on the subject of new, unrecognized keyword
# arguments to setup()):
@@ -182,6 +183,10 @@ PACKAGES = [
def main(sys_argv):
+ if sys.argv[-1] == 'publish':
+ publish()
+ sys.exit()
+
long_description = make_long_description()
template_files = ['*.mustache', '*.txt']