mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 17:58:27 +02:00
Update script
This commit is contained in:
@@ -1,12 +1,14 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
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');
|
const tauriConfig = fs.readFileSync(tauriConfigPath, 'utf8');
|
||||||
if (!process.env.YAAK_VERSION) {
|
const version = process.env.YAAK_VERSION?.replace('v', '');
|
||||||
|
if (!version) {
|
||||||
throw new Error('YAAK_VERSION environment variable not set')
|
throw new Error('YAAK_VERSION environment variable not set')
|
||||||
}
|
}
|
||||||
|
|
||||||
const newTauriConfig = tauriConfig.replaceAll('__YAAK_VERSION__', process.env.YAAK_VERSION.replace('v', ''));
|
console.log('Writing version ' + version + ' to ' + tauriConfigPath)
|
||||||
fs.writeFileSync(configPath, newTauriConfig);
|
const newTauriConfig = tauriConfig.replaceAll('__YAAK_VERSION__', version);
|
||||||
|
fs.writeFileSync(tauriConfigPath, newTauriConfig);
|
||||||
|
|||||||
Reference in New Issue
Block a user