Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/AdFabConnect/abejs
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
#	src/server/routes/post-upload.js
  • Loading branch information
wonknu committed Sep 22, 2016
2 parents ac7aefc + b880123 commit 2e88135
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "abe-cli",
"version": "2.3.14",
"version": "2.3.15",
"description": "Abe command line tool",
"main": "src/server/app.js",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions src/server/routes/post-upload.js
Expand Up @@ -63,9 +63,9 @@ var route = function(req, res, next){
var sfStat = fse.statSync(filePath)

if(sfStat){
var nb = filePath.match(/_([0-9]).(jpg|png|gif|svg|mp4)/)
if(nb && nb[1]) filePath = filePath.replace(/_([0-9])\.(jpg|png|gif|svg|mp4)/, `_${parseInt(nb[1]) + 1}.$2`)
else filePath = filePath.replace(/\.(jpg|png|gif|svg|mp4)/, `_1.$1`)
var nb = filePath.match(/_([0-9]).(jpg|png|gif|svg|mp4)/)
if(nb && nb[1]) filePath = filePath.replace(/_([0-9])\.(jpg|png|gif|svg|mp4)/, `_${parseInt(nb[1]) + 1}.$2`)
else filePath = filePath.replace(/\.(jpg|png|gif|svg|mp4)/, `_1.$1`)
createImage()
}
}
Expand Down Expand Up @@ -97,7 +97,7 @@ var route = function(req, res, next){
var openFile = fse.readFileSync(filePath).toString()
if(openFile === '') throw new Error('')
clearInterval(interval)
if(/\.(jpg|png|gif|svg)/.test(filePath)) resp = Hooks.instance.trigger('afterSaveImage', resp, req)
if(/\.(jpg|png|gif|svg)/.test(filePath)) resp = Hooks.instance.trigger('afterSaveImage', resp, req)
res.set('Content-Type', 'application/json')
res.send(JSON.stringify(resp))
}
Expand Down

0 comments on commit 2e88135

Please sign in to comment.