Skip to content

Commit

Permalink
fix(js): nx release-version resolve-version-spec should normalize fet…
Browse files Browse the repository at this point in the history
…chSpec (#21710)
  • Loading branch information
Coly010 authored Feb 10, 2024
1 parent b1d0294 commit 11e139c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('resolveVersionSpec()', () => {
'projectA',
'1.0.0',
'link:../projectB',
'/packages/fuck'
'/packages/projectB'
)
).toEqual(expect.stringContaining(join('/packages/projectB')));
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as npa from 'npm-package-arg';
import { normalizePath } from '@nx/devkit';

export function resolveVersionSpec(
name: string,
Expand Down Expand Up @@ -26,5 +27,7 @@ export function resolveVersionSpec(

const npaResult = npa.resolve(name, spec, location);

return npaResult.fetchSpec;
return npaResult.fetchSpec.includes('\\')
? normalizePath(npaResult.fetchSpec)
: npaResult.fetchSpec;
}

0 comments on commit 11e139c

Please sign in to comment.