Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
bnmnetp committed May 12, 2015
2 parents 9584470 + e90ae98 commit 79e2878
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ pwm1234 <https://github.com/pwm1234>
rafacarrascosa <https://github.com/rafacarrascosa>
yarko <https://github.com/yarko>
小明 <https://github.com/dongweiming>
Brad Miller <https://github.com/bnmnetp>

11 changes: 11 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
New in master
=============

Features
--------

Bugfixes
--------
* new_post paths are now relative to CWD (Issue #1325)


New in v7.4.1
=============

Expand Down
3 changes: 3 additions & 0 deletions nikola/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions nikola/nikola.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def __init__(self, **config):
self.invariant = config.pop('__invariant__', False)
self.quiet = config.pop('__quiet__', False)
self._doit_config = config.pop('DOIT_CONFIG', {})
self.original_cwd = config.pop('__cwd__', False)
self.configuration_filename = config.pop('__configuration_filename__', False)
self.configured = bool(config)
self.injected_deps = defaultdict(list)
Expand Down
3 changes: 2 additions & 1 deletion nikola/plugins/command/github_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def _execute(self, command, args):
sys.exit(build)

# Clean non-target files
only_on_output, _ = real_scan_files(self.site)
l = self._doitargs['cmds'].get_plugin('list')(config=self.config, **self._doitargs)
only_on_output, _ = real_scan_files(l, self.site)
for f in only_on_output:
os.unlink(f)

Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/command/new_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 79e2878

Please sign in to comment.