2024-06-11 09:33:45 +00:00
|
|
|
#! /usr/bin/env node
|
|
|
|
const { readFileSync, writeFileSync } = require('node:fs');
|
|
|
|
|
2024-06-11 11:37:20 +00:00
|
|
|
const nextVersion = process.argv[2];
|
|
|
|
if (!nextVersion) {
|
2024-06-11 09:33:45 +00: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 11:37:20 +00:00
|
|
|
{ label: `v${nextVersion}`, url: `https://v${nextVersion}.archive.immich.app` },
|
2024-06-11 09:33:45 +00:00
|
|
|
...oldVersions,
|
|
|
|
];
|
|
|
|
|
|
|
|
writeFileSync(filename, JSON.stringify(newVersions, null, 2) + '\n');
|