Component manager commands break the config JS file
When a component is added or removed via pubsweet add
/pubsweet remove
, the config file config/shared.js
is read in via require
, altered, then written out as a string using JSON.stringify
.
Unfortunately this breaks values in the config file which aren't strings:
-
dbPath: process.env.PUBSWEET_DB || path.join(__dirname, '..', 'api', 'db')
gets converted to a hard-coded path -
mode: blogmode
gets removed, asblogmode
is a variable