Skip to content

Commit

Permalink
code: removed \n from packager version checker
Browse files Browse the repository at this point in the history
  • Loading branch information
inlife committed Dec 13, 2021
1 parent 4736a20 commit 16d0ab4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions misc/packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const workdir = path.join(__dirname, 'deploy')
const versionGet = () => {
const data = fs.readFileSync(basefile, 'utf8')

const major = data.match(/ZPL_VERSION_MAJOR\s+([0-9]+)\n/)[1]
const minor = data.match(/ZPL_VERSION_MINOR\s+([0-9]+)\n/)[1]
const patch = data.match(/ZPL_VERSION_PATCH\s+([0-9]+)\n/)[1]
const pre = data.match(/ZPL_VERSION_PRE\s+\"([\.a-z0-9]+)\"\n/)
const major = data.match(/ZPL_VERSION_MAJOR\s+([0-9]+)/)[1]
const minor = data.match(/ZPL_VERSION_MINOR\s+([0-9]+)/)[1]
const patch = data.match(/ZPL_VERSION_PATCH\s+([0-9]+)/)[1]
const pre = data.match(/ZPL_VERSION_PRE\s+\"([\.a-z0-9]+)\"/)

return `${major}.${minor}.${patch}${pre ? '-' + pre[1] : ''}`
}
Expand Down Expand Up @@ -105,4 +105,5 @@ class Bumper extends Plugin {
}

module.exports = Bumper
module.exports.versionGet = versionGet
module.exports.embedIncludes = embedIncludes

0 comments on commit 16d0ab4

Please sign in to comment.