Skip to content

Commit 0fdadf5

Browse files
committedJul 31, 2017
auto: Avoid depending on nikola executable in $PATH
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 86adc66 commit 0fdadf5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎nikola/plugins/command/auto/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ def _execute(self, options, args):
127127
elif Observer is None:
128128
req_missing(['watchdog'], 'use the "auto" command')
129129

130-
self.nikola_cmd = ['nikola', 'build']
130+
if sys.argv[0].endswith('__main__.py'):
131+
self.nikola_cmd = [sys.executable, '-m', 'nikola', 'build']
132+
else:
133+
self.nikola_cmd = [sys.argv[0], 'build']
134+
131135
if self.site.configuration_filename != 'conf.py':
132136
self.nikola_cmd.append('--conf=' + self.site.configuration_filename)
133137

0 commit comments

Comments
 (0)
Please sign in to comment.