improve publish.js
Merge pull request #169 from RobertoUa/barna/EDIT-3626

improve publish.js