Commit b522bccf authored by yann300's avatar yann300

don't overwrite content with junk

parent 014271da
...@@ -64,6 +64,10 @@ module.exports = { ...@@ -64,6 +64,10 @@ module.exports = {
set: function (args, cb) { set: function (args, cb) {
var path = utils.absolutePath(args.path, this.sharedFolder) var path = utils.absolutePath(args.path, this.sharedFolder)
if (fs.existsSync(path) && !isRealPath(path, cb)) return if (fs.existsSync(path) && !isRealPath(path, cb)) return
if (args.content === 'undefined') { // no !!!!!
console.log('trying to write "undefined" ! stopping.')
return
}
this.trackDownStreamUpdate[path] = path this.trackDownStreamUpdate[path] = path
fs.writeFile(path, args.content, 'utf8', (error, data) => { fs.writeFile(path, args.content, 'utf8', (error, data) => {
if (error) console.log(error) if (error) console.log(error)
......
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