Skip to content

Commit

Permalink
path.join
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Sep 16, 2016
1 parent 800fc12 commit e44d902
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/cli/helpers/abe-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import {
Manager
} from '../../cli'

var create = function(template, path, name, req, forceJson = {}, duplicate = false) {
var create = function(template, pathCreate, name, req, forceJson = {}, duplicate = false) {
var p = new Promise((resolve, reject) => {
Hooks.instance.trigger('beforeCreate', template, path, name, req, forceJson)
Hooks.instance.trigger('beforeCreate', template, pathCreate, name, req, forceJson)

var templatePath = fileUtils.getTemplatePath(template.replace(config.root, ""))
var filePath = path.join(path, name)
var filePath = path.join(pathCreate, name)
filePath = cleanSlug(filePath)
filePath = fileUtils.getFilePath(filePath)

Expand All @@ -38,7 +38,7 @@ var create = function(template, path, name, req, forceJson = {}, duplicate = fal
json = resHook.json
text = resHook.text

Hooks.instance.trigger('afterCreate', json, text, path, name, req, forceJson)
Hooks.instance.trigger('afterCreate', json, text, pathCreate, name, req, forceJson)
save(filePath, req.query.selectTemplate, json, text, 'draft', null, 'draft')
.then((resSave) => {
Manager.instance.updateList()
Expand Down
4 changes: 3 additions & 1 deletion src/server/routes/post-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ var route = function(req, res, next){
res.set('Content-Type', 'application/json')
res.send(JSON.stringify(resp))
}
catch(e){}
catch(e){
console.log('post upload finish', e)
}
}
tryUpload()
});
Expand Down

0 comments on commit e44d902

Please sign in to comment.