Skip to content

Commit

Permalink
add updateVersion.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stavares843 authored Nov 9, 2024
1 parent a48854a commit 42133cd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions updateVersion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const fs = require('fs')
const path = require('path')

const VERSION = process.env.RELEASE_VERSION

if (!VERSION) {
console.error("RELEASE_VERSION environment variable is not set.")
process.exit(1)
}

// Path to the file where `DOWNLOAD_LINKS` is defined
const filePath = path.join(__dirname, './src/lib/config.ts')

// Read file content
let content = fs.readFileSync(filePath, 'utf-8')

// Update URLs in DOWNLOAD_LINKS
content = content.replace(/\/v\d+\.\d+\.\d+\//g, `/v${VERSION}/`)

fs.writeFileSync(filePath, content);

console.log(`Updated DOWNLOAD_LINKS version to v${VERSION}`)

0 comments on commit 42133cd

Please sign in to comment.