From f23d58ec6029781c4914e47f42c8844398001b19 Mon Sep 17 00:00:00 2001 From: Sylvain Cau <10268458+sylc@users.noreply.github.com> Date: Fri, 23 Feb 2024 22:10:49 +0800 Subject: [PATCH] fix: revert using jsr for now. (#20) --- README.md | 2 +- src/upgrader.ts | 10 +++++----- tools/.release_up.json | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 081c3b5..3f3545c 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ### Install ``` -deno install -f jsr:@sylc/dkill +deno install -f --allow-run --allow-net https://deno.land/x/dkill@0.11.0/cli.ts -n dkill ``` You can then use it using command `dkill` diff --git a/src/upgrader.ts b/src/upgrader.ts index 55642f3..40ec4fa 100644 --- a/src/upgrader.ts +++ b/src/upgrader.ts @@ -1,7 +1,5 @@ -async function fetchNewCommand(version: string) { - const readMeRes = await fetch( - `https://jsr.io/@sylc/dkill/${version}/README.md`, - ); +async function fetchNewCommand(url: string) { + const readMeRes = await fetch(url); const readmeText = await readMeRes.text(); const parsed = readmeText.match(/deno install .*/); @@ -27,7 +25,9 @@ export async function upgrader(config: { if (config.currentVersion !== versions.latest) { // retrieve command from new version // const command = await fetchNewCommand(versions.latest); - const command = await fetchNewCommand("0.10.1"); + const command = await fetchNewCommand( + `https://deno.land/x/${config.packageName}@${versions.latest}/README.md`, + ); console.log("A new version is available. Run the below command to update:"); console.log(command); } else { diff --git a/tools/.release_up.json b/tools/.release_up.json index 344e2ef..b0944eb 100644 --- a/tools/.release_up.json +++ b/tools/.release_up.json @@ -4,6 +4,10 @@ "release": true }, "regex": [ + { + "file": "README.md", + "patterns": ["(?<=@)(.*)(?=\/cli)"] + }, { "file": "deno.json", "patterns": [