chore: Add version.txt in build (#1395)

This commit is contained in:
Rémi Marseault 2023-12-07 19:50:37 +01:00 committed by GitHub
parent 69398e02a5
commit 2959461409
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -7,6 +7,7 @@
"start": "vite",
"dev": "vite",
"build": "vue-tsc && vite build",
"postbuild": "node write-version.cjs",
"check-build": "vue-tsc",
"preview": "vite preview",
"lint": "eslint --fix --ignore-path .gitignore && prettier . -w -u --ignore-path .gitignore",

8
write-version.cjs Normal file
View file

@ -0,0 +1,8 @@
const fs = require('fs')
const path = require('path')
const packageJson = require('./package.json')
const version = packageJson.version
const filePath = path.join(__dirname, 'vuetorrent', 'version.txt')
fs.writeFileSync(filePath, version)