summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Barrell <rchrd@brrll.co.uk>2011-11-07 13:09:53 -0800
committerRichard Barrell <rchrd@brrll.co.uk>2011-11-07 13:09:53 -0800
commit54624f36c19b3cd5d107ecd9a1f307651f561ccd (patch)
tree9906014b5e10ecc92feb6fae0351b08fd30af161
parente1ddd184c7c1ebb4b7a5e333325da44e8b21c99d (diff)
downloadpyramid-54624f36c19b3cd5d107ecd9a1f307651f561ccd.tar.gz
pyramid-54624f36c19b3cd5d107ecd9a1f307651f561ccd.tar.bz2
pyramid-54624f36c19b3cd5d107ecd9a1f307651f561ccd.zip
Have pcreate base the project name on just the basedir of the target output path, and use the target output path (pretty much) as-is, so that pcreate no longer appears to go nuts when calling it with an absolute path.
-rw-r--r--pyramid/scripts/pcreate.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pyramid/scripts/pcreate.py b/pyramid/scripts/pcreate.py
index 47a709af4..20e531956 100644
--- a/pyramid/scripts/pcreate.py
+++ b/pyramid/scripts/pcreate.py
@@ -4,6 +4,7 @@
import optparse
import os
+import os.path
import pkg_resources
import re
import sys
@@ -64,8 +65,8 @@ class PCreateCommand(object):
def render_scaffolds(self):
options = self.options
args = self.args
- project_name = args[0].lstrip(os.path.sep)
- output_dir = os.path.normpath(os.path.join(os.getcwd(), project_name))
+ project_name = os.path.basename(args[0])
+ output_dir = os.path.normpath(args[0])
pkg_name = _bad_chars_re.sub('', project_name.lower())
safe_name = pkg_resources.safe_name(project_name)
egg_name = pkg_resources.to_filename(safe_name)