From c5775f20cabe0aff4ec046a35ab3aed2c07ef0b1 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Sun, 9 Jun 2024 17:21:15 -0400 Subject: [PATCH] fix(version): Use path.dirname for generality --- bids-validator/src/version.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bids-validator/src/version.ts b/bids-validator/src/version.ts index fa82792cb..12294933f 100644 --- a/bids-validator/src/version.ts +++ b/bids-validator/src/version.ts @@ -1,4 +1,5 @@ import gitmeta from './.git-meta.json' with { type: 'json' } +import { dirname } from './deps/path.ts' /** * Determine the version of the currently running script. @@ -24,7 +25,7 @@ export async function getVersion(): Promise { const url = new URL(Deno.mainModule) if (url.protocol === 'file:') { - version = await getLocalVersion(url.pathname.split('/').slice(0, -1).join('/')) + version = await getLocalVersion(dirname(url.pathname)) if (version) { return version } } else if (url.protocol === 'https:' || url.protocol === 'http:') { version = getRemoteVersion(url)