mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-20 16:43:53 +01:00
Update script
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const configPath = path.join(__dirname, '../src-tauri/tauri.conf.json');
|
||||
const tauriConfigPath = path.join(__dirname, '../src-tauri/tauri.conf.json');
|
||||
|
||||
const tauriConfig = fs.readFileSync(configPath, 'utf8');
|
||||
if (!process.env.YAAK_VERSION) {
|
||||
const tauriConfig = fs.readFileSync(tauriConfigPath, 'utf8');
|
||||
const version = process.env.YAAK_VERSION?.replace('v', '');
|
||||
if (!version) {
|
||||
throw new Error('YAAK_VERSION environment variable not set')
|
||||
}
|
||||
|
||||
const newTauriConfig = tauriConfig.replaceAll('__YAAK_VERSION__', process.env.YAAK_VERSION.replace('v', ''));
|
||||
fs.writeFileSync(configPath, newTauriConfig);
|
||||
console.log('Writing version ' + version + ' to ' + tauriConfigPath)
|
||||
const newTauriConfig = tauriConfig.replaceAll('__YAAK_VERSION__', version);
|
||||
fs.writeFileSync(tauriConfigPath, newTauriConfig);
|
||||
|
||||
Reference in New Issue
Block a user