Skip to content

Commit

Permalink
fix: improves D2 version detection logic
Browse files Browse the repository at this point in the history
Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com>
  • Loading branch information
martrapp and HiDeoo authored Mar 8, 2024
1 parent a45ea6f commit 15735a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/astro-d2/libs/d2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async function getD2Version() {
try {
const [version] = await exec('d2', ['--version'])

if (!version || !/^\d+\.\d+\.\d+$/.test(version)) {
if (!version || !/^v?\d+\.\d+\.\d+/.test(version)) {
throw new Error(`Invalid D2 version, got '${version}'.`)
}

Expand Down

0 comments on commit 15735a6

Please sign in to comment.