From 65d5a6f9ad02912d44be35651add1c1f69944d72 Mon Sep 17 00:00:00 2001 From: ryu <114303361+ryuapp@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:39:20 +0900 Subject: [PATCH 1/2] fix: old deno gives an error when using `deno -v` --- src/hooks/dependencies.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/hooks/dependencies.ts b/src/hooks/dependencies.ts index 3f9aab1..572c808 100644 --- a/src/hooks/dependencies.ts +++ b/src/hooks/dependencies.ts @@ -47,8 +47,14 @@ const registerInstallationHook = ( if (!installedPackageManagerNames.length) return // If version 1 of Deno is installed, it will not be suggested because it doesn't have "deno install". if (installedPackageManagerNames.includes('deno')) { - const { stdout } = await execa('deno', ['-v']) - if (stdout.split(' ')[1].split('.')[0] == '1') { + let isVersion1 = false + try { + const { stdout } = await execa('deno', ['-V']) + isVersion1 = stdout.split(' ')[1].split('.')[0] == '1' + } catch { + isVersion1 = true + } + if (isVersion1) { installedPackageManagerNames.splice( installedPackageManagerNames.indexOf('deno'), 1, From e8c6f431bf1e3959461bf491fe19ef8a44f75649 Mon Sep 17 00:00:00 2001 From: ryu <114303361+ryuapp@users.noreply.github.com> Date: Thu, 10 Oct 2024 21:58:57 +0900 Subject: [PATCH 2/2] check version with -v --- src/hooks/dependencies.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/dependencies.ts b/src/hooks/dependencies.ts index 572c808..dc706b7 100644 --- a/src/hooks/dependencies.ts +++ b/src/hooks/dependencies.ts @@ -49,7 +49,7 @@ const registerInstallationHook = ( if (installedPackageManagerNames.includes('deno')) { let isVersion1 = false try { - const { stdout } = await execa('deno', ['-V']) + const { stdout } = await execa('deno', ['-v']) isVersion1 = stdout.split(' ')[1].split('.')[0] == '1' } catch { isVersion1 = true