fix(js): nx release-version resolve-version-spec should normalize fetchSpec (#21710)
This commit is contained in:
parent
b1d0294d46
commit
11e139c7ec
@ -76,7 +76,7 @@ describe('resolveVersionSpec()', () => {
|
|||||||
'projectA',
|
'projectA',
|
||||||
'1.0.0',
|
'1.0.0',
|
||||||
'link:../projectB',
|
'link:../projectB',
|
||||||
'/packages/fuck'
|
'/packages/projectB'
|
||||||
)
|
)
|
||||||
).toEqual(expect.stringContaining(join('/packages/projectB')));
|
).toEqual(expect.stringContaining(join('/packages/projectB')));
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import * as npa from 'npm-package-arg';
|
import * as npa from 'npm-package-arg';
|
||||||
|
import { normalizePath } from '@nx/devkit';
|
||||||
|
|
||||||
export function resolveVersionSpec(
|
export function resolveVersionSpec(
|
||||||
name: string,
|
name: string,
|
||||||
@ -26,5 +27,7 @@ export function resolveVersionSpec(
|
|||||||
|
|
||||||
const npaResult = npa.resolve(name, spec, location);
|
const npaResult = npa.resolve(name, spec, location);
|
||||||
|
|
||||||
return npaResult.fetchSpec;
|
return npaResult.fetchSpec.includes('\\')
|
||||||
|
? normalizePath(npaResult.fetchSpec)
|
||||||
|
: npaResult.fetchSpec;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user