2021-08-24 13:36:48 +08:00
|
|
|
import fs from 'fs'
|
|
|
|
import path from 'path'
|
|
|
|
import pkg from '../packages/element-plus/package.json' // need to be checked
|
2020-12-23 16:57:31 +08:00
|
|
|
const tagVer = process.env.TAG_VERSION
|
2021-08-24 13:36:48 +08:00
|
|
|
let version = ''
|
|
|
|
|
2020-12-23 16:57:31 +08:00
|
|
|
if (tagVer) {
|
|
|
|
version = tagVer.startsWith('v') ? tagVer.slice(1) : tagVer
|
|
|
|
} else {
|
2021-08-24 13:36:48 +08:00
|
|
|
version = pkg.version
|
2020-12-23 16:57:31 +08:00
|
|
|
}
|
2021-08-24 13:36:48 +08:00
|
|
|
|
2020-12-23 16:57:31 +08:00
|
|
|
fs.writeFileSync(
|
|
|
|
path.resolve(__dirname, '../packages/element-plus/version.ts'),
|
|
|
|
`export const version = '${version}'
|
|
|
|
`,
|
|
|
|
)
|