diff --git a/src/backend/common/handlers/fileWriterProcessor.js b/src/backend/common/handlers/fileWriterProcessor.js index dad4d7ac4..bdb624a83 100644 --- a/src/backend/common/handlers/fileWriterProcessor.js +++ b/src/backend/common/handlers/fileWriterProcessor.js @@ -1,6 +1,7 @@ "use strict"; const fs = require("fs-extra"); +const path = require("path"); const logger = require("../../logwrapper"); function doesTextExistInFile(filepath, text) { @@ -75,6 +76,7 @@ exports.run = async effect => { fs.appendFileSync(effect.filepath, text + "\n", "utf8"); } } else { + fs.ensureDirSync(path.dirname(effect.filepath)); fs.appendFileSync(effect.filepath, text + "\n", "utf8"); } } else if (effect.writeMode === "delete") {