Prepare upgrade command for release

This commit is contained in:
Zef Hemel
2025-08-21 16:30:56 +02:00
parent 49c968cd8c
commit 041b1cdcfe
+17 -11
View File
@@ -1,21 +1,13 @@
import { dirname } from "@std/path";
export function upgradeCommand() {
// TODO: Update this before a proper release
console.log("Not implemented yet");
}
export async function upgradeEdgeCommand() {
console.log("Now going to attempt an edge upgrade...");
async function upgrade(urlPrefix: string) {
const installDir = dirname(Deno.execPath());
console.log("Install dir:", installDir);
const tmpDir = Deno.makeTempDirSync();
// const zipUrl = "https://github.com/silverbulletmd/silverbullet/releases/download/test-release/silverbullet-server-apple-aarch64.zip";
const zipUrl =
`https://github.com/silverbulletmd/silverbullet/releases/download/edge/silverbullet-server-${Deno.build.os}-${Deno.build.arch}.zip`;
const zipUrl = urlPrefix +
`/silverbullet-server-${Deno.build.os}-${Deno.build.arch}.zip`;
const zipPath = `${tmpDir}/silverbullet.zip`;
console.log("Downloading from", zipUrl);
const command = new Deno.Command("curl", {
@@ -59,3 +51,17 @@ export async function upgradeEdgeCommand() {
await Deno.remove(zipPath);
console.log("And done! Restart your server to get the latest and greatest!");
}
export async function upgradeCommand() {
console.log("Now going to attempt an upgrade...");
await upgrade(
"https://github.com/silverbulletmd/silverbullet/releases/latest/download",
);
}
export async function upgradeEdgeCommand() {
console.log("Now going to attempt an edge upgrade...");
await upgrade(
"https://github.com/silverbulletmd/silverbullet/releases/download/edge",
);
}