chore: update script

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-08-16 15:39:53 +08:00
parent 34373f9578
commit df81a6740b
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
2 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,4 @@
const { resolve } = require('path')
const { resolve } = require('node:path')
const axios = require('axios')
const { fs } = require('zx-cjs')
const {
@ -8,7 +8,10 @@ const Package = require('./package.json')
const endpoint = `https://api.github.com/repos/${repo}/releases/latest`
const latestVersion = async () => {
const res = await axios.get(endpoint)
const res = await axios.get(endpoint).catch((error) => {
console.error(error.message)
process.exit(1)
})
return res.data.tag_name.replace(/^v/, '')
}
async function main() {

View File

@ -31,7 +31,6 @@ export default sxzz(
eqeqeq: 'off',
'no-void': 0,
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/consistent-type-assertions': 0,
'no-restricted-syntax': 0,
'unicorn/filename-case': 0,