remove redundant code from publish.js