mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-16 23:27:23 -05:00
added discord rpc
This commit is contained in:
20
release.js
20
release.js
@@ -158,6 +158,24 @@ function createGitLabRelease(tag, releaseLinks) {
|
||||
});
|
||||
}
|
||||
|
||||
function injectDiscordConfig() {
|
||||
const envPath = path.join(__dirname, 'config', 'env.json');
|
||||
const cfg = fs.existsSync(envPath) ? JSON.parse(fs.readFileSync(envPath, 'utf8')) : {};
|
||||
const tmdb = process.env.TMDB_API_KEY || process.env.TMDB_KEY || '';
|
||||
const clientId = process.env.DISCORD_CLIENT_ID || '';
|
||||
|
||||
cfg.discord = cfg.discord || {};
|
||||
if (tmdb) {
|
||||
cfg.discord.tmdbApiKey = tmdb;
|
||||
} else {
|
||||
console.log('[WARNING] No TMDB_API_KEY or TMDB_KEY set. Discord posters will fall back to page data.');
|
||||
}
|
||||
if (clientId) cfg.discord.clientId = clientId;
|
||||
|
||||
fs.mkdirSync(path.dirname(envPath), { recursive: true });
|
||||
fs.writeFileSync(envPath, JSON.stringify(cfg, null, 2) + '\n', 'utf8');
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const isFullBuild = process.argv.includes('--installer');
|
||||
const customTag = process.argv.find(arg => arg.startsWith('--tag='))?.split('=')[1];
|
||||
@@ -166,6 +184,8 @@ async function main() {
|
||||
|
||||
console.log(`Building Vyla Home Release (${version})`);
|
||||
|
||||
injectDiscordConfig();
|
||||
|
||||
console.log('[1/4] Building update payload and manifest...');
|
||||
execSync('node build-pipeline.js', { stdio: 'inherit', env: { ...process.env, RELEASE_VERSION: version } });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user