diff --git a/deno.jsonc b/deno.jsonc index b27aeeb..6ca69ee 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -4,7 +4,7 @@ "@std/fs": "jsr:@std/fs", "@std/semver": "jsr:@std/semver", "@std/path": "jsr:@std/path", - "@std/streams": "jsr:@std/streams", + "@std/io/write-all": "jsr:@std/io/write-all", "sqlite": "https://deno.land/x/sqlite@v3.5.0/mod.ts" }, "tasks": { diff --git a/deno.lock b/deno.lock index 439c9a8..8861406 100644 --- a/deno.lock +++ b/deno.lock @@ -2,23 +2,14 @@ "version": "3", "packages": { "specifiers": { - "jsr:@std/assert@^0.220.1": "jsr:@std/assert@0.220.1", - "jsr:@std/bytes@^0.220.1": "jsr:@std/bytes@0.220.1", "jsr:@std/crypto": "jsr:@std/crypto@1.0.3", "jsr:@std/fs": "jsr:@std/fs@1.0.4", - "jsr:@std/io@^0.220.1": "jsr:@std/io@0.220.1", + "jsr:@std/io": "jsr:@std/io@0.224.9", "jsr:@std/path": "jsr:@std/path@1.0.6", "jsr:@std/path@^1.0.6": "jsr:@std/path@1.0.6", - "jsr:@std/semver": "jsr:@std/semver@0.220.1", - "jsr:@std/streams": "jsr:@std/streams@0.220.1" + "jsr:@std/semver": "jsr:@std/semver@0.220.1" }, "jsr": { - "@std/assert@0.220.1": { - "integrity": "88710d54f3afdd7a5761e7805abba1f56cd14e4b212feffeb3e73a9f77482425" - }, - "@std/bytes@0.220.1": { - "integrity": "e522cdc7c152cfc8a09bd618618cbc710dcf57003ab6fab3a6c37ff4c88aa3db" - }, "@std/crypto@1.0.3": { "integrity": "a2a32f51ddef632d299e3879cd027c630dcd4d1d9a5285d6e6788072f4e51e7f" }, @@ -28,26 +19,14 @@ "jsr:@std/path@^1.0.6" ] }, - "@std/io@0.220.1": { - "integrity": "c14c3237cfc73dd8086ac82673212939f8c49f0803d6da68eea32249caffdd67", - "dependencies": [ - "jsr:@std/assert@^0.220.1", - "jsr:@std/bytes@^0.220.1" - ] + "@std/io@0.224.9": { + "integrity": "4414664b6926f665102e73c969cfda06d2c4c59bd5d0c603fd4f1b1c840d6ee3" }, "@std/path@1.0.6": { "integrity": "ab2c55f902b380cf28e0eec501b4906e4c1960d13f00e11cfbcd21de15f18fed" }, "@std/semver@0.220.1": { "integrity": "f3df4abc715ad723680011f19d2934cfd436b4c41c317e82bfc14ac586b3b724" - }, - "@std/streams@0.220.1": { - "integrity": "f26c7cb98c471af89de8309a0246cccb4c9bb6f3c639bd84aee5488127dc8545", - "dependencies": [ - "jsr:@std/assert@^0.220.1", - "jsr:@std/bytes@^0.220.1", - "jsr:@std/io@^0.220.1" - ] } } }, @@ -137,9 +116,9 @@ "dependencies": [ "jsr:@std/crypto", "jsr:@std/fs", + "jsr:@std/io", "jsr:@std/path", - "jsr:@std/semver", - "jsr:@std/streams" + "jsr:@std/semver" ] } } diff --git a/info.plist b/info.plist index 6183623..ddb313f 100644 --- a/info.plist +++ b/info.plist @@ -126,7 +126,7 @@ runningsubtext Octocat initialising...please wait whilst we prefetch data script - $(which deno) run --allow-env --allow-write --allow-read --allow-net ${INIT_FILE} filter $argv[1] + PATH="${HOME}/.deno/bin:${PATH}";$(which deno) run --allow-env --allow-write --allow-read --allow-net ${INIT_FILE} filter $argv[1] scriptargtype 1 scriptfile @@ -246,7 +246,7 @@ echo "You are running the latest version (${alfred_workflow_version})" escaping 102 script - $(which deno) run --allow-net --allow-run --allow-env --allow-write --allow-read ${INIT_FILE} action $argv[1] + PATH="${HOME}/.deno/bin:${PATH}";$(which deno) run --allow-net --allow-run --allow-env --allow-write --allow-read ${INIT_FILE} action $argv[1] scriptargtype 1 scriptfile diff --git a/src/helpers/log.ts b/src/helpers/log.ts index 9d7f53b..91a3261 100644 --- a/src/helpers/log.ts +++ b/src/helpers/log.ts @@ -1,4 +1,4 @@ -import { writeAllSync } from "@std/streams"; +import { writeAllSync } from "@std/io/write-all"; export function log(message: string) { const contentBytes = new TextEncoder().encode(message); diff --git a/src/helpers/updateAvailable.ts b/src/helpers/updateAvailable.ts index a857e42..ca4563a 100644 --- a/src/helpers/updateAvailable.ts +++ b/src/helpers/updateAvailable.ts @@ -15,11 +15,15 @@ export async function updateAvailableItem( await _internals.cacheRelease(now, config); - const isValid = lessOrEqual( - parse(config.latestVersion), - parse(config.currentVersion), - ); - if (isValid) return null; + try { + const isValid = lessOrEqual( + parse(config.latestVersion), + parse(config.currentVersion), + ); + if (isValid) return null; + } catch (_) { + return null; + } const item: BuildItem = { title: `Update available (${config.latestVersion})`,