Commit b35ec804 authored by Aral Balkan's avatar Aral Balkan
Browse files

Fix enable command crash on systems without Node.js installed

Ported from Site.js: site.js/app@160379ef
parent 2f6b818d
......@@ -82,8 +82,7 @@ function enable (args) {
const _pathToServe = args.positional.length === 1 ? args.positional[0] : '.'
const binaryExecutable = '/usr/local/bin/place'
const sourceDirectory = path.resolve(__dirname, '..', '..')
const nodeExecutable = `node ${path.join(sourceDirectory, 'bin/place')}`
const executable = runtime.isBinary ? binaryExecutable : nodeExecutable
const executable = runtime.isBinary ? binaryExecutable : `${childProcess.execSync('which node').toString().trim()} ${path.join(sourceDirectory, 'bin/place')}`
// It is a common mistake to start the server in a .dynamic folder (or subfolder)
// or a .hugo folder or subfolder. In these cases, try to recover and do the right thing.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment