fix(build): generate Suwayomi WebUI revision
This commit is contained in:
16
tools/scripts/writeWebUIRevision.ts
Normal file
16
tools/scripts/writeWebUIRevision.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { execFileSync } from 'node:child_process';
|
||||
import { writeFileSync } from 'node:fs';
|
||||
import { formatWebUIRevision } from '@/features/theme/services/MaterialYouRevision.ts';
|
||||
|
||||
const commitCount = Number(execFileSync('git', ['rev-list', 'HEAD', '--count'], { encoding: 'utf8' }).trim());
|
||||
const revisionPath = new URL('../../build/revision', import.meta.url);
|
||||
|
||||
writeFileSync(revisionPath, formatWebUIRevision(commitCount), 'utf8');
|
||||
Reference in New Issue
Block a user