Commit 160379ef authored by Aral Balkan's avatar Aral Balkan
Browse files

Fixes #258: crash on enable on systems without Node.js installed

parent a8e709dd
...@@ -76,8 +76,7 @@ function enable (args) { ...@@ -76,8 +76,7 @@ function enable (args) {
const _pathToServe = args.positional.length === 1 ? args.positional[0] : '.' const _pathToServe = args.positional.length === 1 ? args.positional[0] : '.'
const binaryExecutable = '/usr/local/bin/site' const binaryExecutable = '/usr/local/bin/site'
const sourceDirectory = path.resolve(__dirname, '..', '..') const sourceDirectory = path.resolve(__dirname, '..', '..')
const nodeExecutable = `${childProcess.execSync('which node').toString().trim()} ${path.join(sourceDirectory, 'bin/site.js')}` const executable = runtime.isBinary ? binaryExecutable : `${childProcess.execSync('which node').toString().trim()} ${path.join(sourceDirectory, 'bin/site.js')}`
const executable = runtime.isBinary ? binaryExecutable : nodeExecutable
// It is a common mistake to start the server in a .dynamic folder (or subfolder) // 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. // 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