Skip to content

Commit

Permalink
fix: old deno gives an error when using deno -v
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuapp committed Oct 10, 2024
1 parent b3ce4fe commit 65d5a6f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/hooks/dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 65d5a6f

Please sign in to comment.