Allow /task/new/init to be called multiple times with same set-uuid

pull/98/head
Piero Toffanin 2019-10-14 12:25:19 -04:00
rodzic 938b13f21f
commit 4a0adcd883
1 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -187,11 +187,10 @@ module.exports = {
},
cb => {
fs.stat(srcPath, (err, stat) => {
if (err && err.code === 'ENOENT') cb();
else cb(new Error(`Directory exists (should not have happened)`));
if (err && err.code === 'ENOENT') fs.mkdir(srcPath, undefined, cb);
else cb(); // Dir already exists
});
},
cb => fs.mkdir(srcPath, undefined, cb),
cb => {
fs.writeFile(bodyFile, JSON.stringify(req.body), {encoding: 'utf8'}, cb);
},