Commit 9cbb08be authored by Aral Balkan's avatar Aral Balkan
Browse files

Fix enable command crash when running in Node on older systemd

(Issue encountered on systemd version 237 on elementary OS 5.1.7 Hera
parent 0be25a59
......@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [16.0.2] - unreleased
### Fixed
- No longer crashes on enable command when running under Node.js on older systemd versions that require an absolute path for the binary in the service unit description. (Bug encountered on elementary OS Hera 5.1.7).
## [16.0.1] - 2020-11-07
### Fixed
......
......@@ -76,7 +76,7 @@ function enable (args) {
const _pathToServe = args.positional.length === 1 ? args.positional[0] : '.'
const binaryExecutable = '/usr/local/bin/site'
const sourceDirectory = path.resolve(__dirname, '..', '..')
const nodeExecutable = `node ${path.join(sourceDirectory, 'bin/site.js')}`
const nodeExecutable = `${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)
......
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