Skip to content

Commit

Permalink
fix(version): Use path.dirname for generality
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Jun 10, 2024
1 parent d5eb0e8 commit c5775f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bids-validator/src/version.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -24,7 +25,7 @@ export async function getVersion(): Promise<string> {

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)
Expand Down

0 comments on commit c5775f2

Please sign in to comment.