Skip to content

Commit

Permalink
fix: improper json found in case when the same name of document did e…
Browse files Browse the repository at this point in the history
…xist in mny place (/data/index.json and /data/anotherdir/index.json)
  • Loading branch information
gregorybesson committed Oct 15, 2016
1 parent c83f65f commit ce82d12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/cli/cms/data/revision.js
Expand Up @@ -65,8 +65,7 @@ export function getFilesRevision(urls, fileName) {
export function getVersions(docPath) {
var result = []
var files = Manager.instance.getList()
var dataFile = docPath.replace('.' + config.files.templates.extension, '.json')

var dataFile = path.join(config.data.url, docPath.replace('.' + config.files.templates.extension, '.json'))
Array.prototype.forEach.call(files, (file) => {
if (file.path.indexOf(dataFile) > -1) {
result = file.revisions
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cms/operations/duplicate.js
Expand Up @@ -14,7 +14,7 @@ var duplicate = function(oldFilePath, template, newPath, name, req, isUpdate = f
var revisions = []
if(oldFilePath != null) {
var files = Manager.instance.getList()
var fileWithoutExtension = oldFilePath.replace('.' + config.files.templates.extension, '')
var fileWithoutExtension = oldFilePath.replace('.' + config.files.templates.extension, '.json')

var doc = null
Array.prototype.forEach.call(files, (file) => {
Expand Down

0 comments on commit ce82d12

Please sign in to comment.