Skip to content

Commit

Permalink
fix: right syntax for a tricky node inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Dec 28, 2016
1 parent 9a771d1 commit 447137c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cli/cms/operations/duplicate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import path from 'path'
import url from 'url'
import extend from 'extend'

import {
Expand All @@ -17,7 +16,7 @@ const duplicate = function(oldPostUrl, template, newPath, name, req, isUpdate =

let json = {}
let revisions = []
const newPostUrl = url.resolve(newPath, coreUtils.slug.clean(name))
const newPostUrl = path.posix.join(newPath, coreUtils.slug.clean(name))
if(oldPostUrl != null) {
const files = Manager.instance.getList()
const oldPostDataPath = path.join(config.root, config.data.url, oldPostUrl.replace('.' + config.files.templates.extension, '.json'))
Expand All @@ -39,7 +38,7 @@ const duplicate = function(oldPostUrl, template, newPath, name, req, isUpdate =

var pCreate = cmsOperations.create(template, newPath, name, req, json, (isUpdate) ? false : true)
pCreate.then((resSave) => {
if (isUpdate && oldPostUrl !== url.resolve('/', newPostUrl)) {
if (isUpdate && oldPostUrl !== path.posix.join('/', newPostUrl)) {
abeExtend.hooks.instance.trigger('beforeUpdate', json, oldPostUrl, template, newPath, name, req, isUpdate)
cmsOperations.remove.remove(oldPostUrl)
}
Expand Down

0 comments on commit 447137c

Please sign in to comment.