2024-06-11 11:33:45 +02:00
|
|
|
#! /usr/bin/env node
|
|
|
|
const { readFileSync, writeFileSync } = require('node:fs');
|
|
|
|
|
2024-06-11 13:37:20 +02:00
|
|
|
const nextVersion = process.argv[2];
|
|
|
|
if (!nextVersion) {
|
2024-06-11 11:33:45 +02:00
|
|
|
console.log('Usage: archive-version.js <version>');
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
const filename = './docs/static/archived-versions.json';
|
|
|
|
const oldVersions = JSON.parse(readFileSync(filename));
|
|
|
|
const newVersions = [
|
2024-06-11 13:37:20 +02:00
|
|
|
{ label: `v${nextVersion}`, url: `https://v${nextVersion}.archive.immich.app` },
|
2024-06-11 11:33:45 +02:00
|
|
|
...oldVersions,
|
|
|
|
];
|
|
|
|
|
|
|
|
writeFileSync(filename, JSON.stringify(newVersions, null, 2) + '\n');
|