Markdown editor improvements

This commit is contained in:
NGPixel
2016-09-10 22:53:21 -04:00
parent 492bb9efa6
commit 97602b51c8
160 changed files with 558 additions and 123 deletions

View File

@@ -387,9 +387,29 @@ module.exports = {
let self = this;
if(_.isEmpty(entryPath) || entryPath === 'home') {
return Promise.reject(new Error('Invalid path!'));
}
return git.moveDocument(entryPath, newEntryPath).then(() => {
return git.commitDocument(newEntryPath).then(() => {
// Delete old cache version
let oldEntryCachePath = self.getCachePath(entryPath);
fs.unlinkAsync(oldEntryCachePath).catch((err) => { return true; });
// Delete old index entry
ws.emit('searchDel', {
auth: WSInternalKey,
entryPath
});
// Create cache for new entry
return self.updateCache(newEntryPath);
});
});