Skip to content
Permalink
Browse files

Fix #1325

  • Loading branch information
ralsina committed May 11, 2015
1 parent a573ed9 commit 9ea452281577046efe7e93275da5c62dd8aaac50
Showing with 6 additions and 1 deletion.
  1. +1 −0 CHANGES.txt
  2. +3 −0 nikola/__main__.py
  3. +1 −0 nikola/nikola.py
  4. +1 −1 nikola/plugins/command/new_post.py
@@ -11,6 +11,7 @@ Features
Bugfixes
--------

* new_post paths are now relative to CWD (Issue #1325)
* Handle strange URLs, like ed2k:// (Issue #1695)
* Fix very old metadata format support (Issue #1689)

@@ -90,6 +90,8 @@ def main(args=None):
quiet = True
global config

original_cwd = os.getcwd()

# Those commands do not require a `conf.py`. (Issue #1132)
# Moreover, actually having one somewhere in the tree can be bad, putting
# the output of that command (the new site) in an unknown directory that is
@@ -145,6 +147,7 @@ def main(args=None):
config['__invariant__'] = invariant
config['__quiet__'] = quiet
config['__configuration_filename__'] = conf_filename
config['__cwd__'] = original_cwd

site = Nikola(**config)
DN = DoitNikola(site, quiet)
@@ -285,6 +285,7 @@ def __init__(self, **config):
self.colorful = config.pop('__colorful__', False)
self.invariant = config.pop('__invariant__', False)
self.quiet = config.pop('__quiet__', False)
self.original_cwd = config.pop('__cwd__', False)
self.configuration_filename = config.pop('__configuration_filename__', False)
self.configured = bool(config)
self.injected_deps = defaultdict(list)
@@ -345,7 +345,7 @@ def _execute(self, options, args):
if not path:
txt_path = os.path.join(output_path, slug + suffix)
else:
txt_path = path
txt_path = os.path.join(self.site.original_cwd, path)

if (not onefile and os.path.isfile(meta_path)) or \
os.path.isfile(txt_path):

0 comments on commit 9ea4522

Please sign in to comment.
You can’t perform that action at this time.