Skip to content

Commit

Permalink
fix: revert using jsr for now. (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylc committed Feb 23, 2024
1 parent 2ac5e5c commit f23d58e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
10 changes: 5 additions & 5 deletions src/upgrader.ts
Original file line number Diff line number Diff line change
@@ -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 .*/);
Expand All @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions tools/.release_up.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"release": true
},
"regex": [
{
"file": "README.md",
"patterns": ["(?<=@)(.*)(?=\/cli)"]
},
{
"file": "deno.json",
"patterns": [
Expand Down

0 comments on commit f23d58e

Please sign in to comment.