Skip to content

Commit

Permalink
Actually write the file
Browse files Browse the repository at this point in the history
  • Loading branch information
gschier committed Jun 20, 2024
1 parent d70254b commit bd948f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/replace-version.cjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
const path = require('path');
const fs = require('fs');

const tauriConfig = fs.readFileSync(path.join(__dirname, '../src-tauri/tauri.conf.json'), 'utf8');
const configPath = path.join(__dirname, '../src-tauri/tauri.conf.json');

const tauriConfig = fs.readFileSync(configPath, 'utf8');
if (!process.env.YAAK_VERSION) {
throw new Error('YAAK_VERSION environment variable not set')
}

console.log(tauriConfig.replaceAll('__YAAK_VERSION__', process.env.YAAK_VERSION.replace('v', '')));
const newTauriConfig = tauriConfig.replaceAll('__YAAK_VERSION__', process.env.YAAK_VERSION.replace('v', ''));
fs.writeFileSync(configPath, newTauriConfig);

0 comments on commit bd948f9

Please sign in to comment.