Merge pull request #28151 from davidgiga1993/win-path
fix: wrong usage of fslib causes wrong paths to be used on windows
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'yarn-plugin-backstage': minor
|
||||
---
|
||||
|
||||
Fixed windows path resolution on windows
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
httpUtils,
|
||||
structUtils,
|
||||
} from '@yarnpkg/core';
|
||||
import { ppath, xfs } from '@yarnpkg/fslib';
|
||||
import { ppath, npath, xfs } from '@yarnpkg/fslib';
|
||||
import { valid as semverValid } from 'semver';
|
||||
import { BACKSTAGE_JSON, findPaths } from '@backstage/cli-common';
|
||||
import { getManifestByVersion } from '@backstage/release-manifests';
|
||||
@@ -28,7 +28,9 @@ import { getManifestByVersion } from '@backstage/release-manifests';
|
||||
import { PROTOCOL } from './constants';
|
||||
|
||||
export const getCurrentBackstageVersion = () => {
|
||||
const workspaceRoot = ppath.resolve(findPaths(ppath.cwd()).targetRoot);
|
||||
const workspaceRoot = npath.toPortablePath(
|
||||
findPaths(npath.fromPortablePath(ppath.cwd())).targetRoot,
|
||||
);
|
||||
|
||||
const backstageJson = xfs.readJsonSync(
|
||||
ppath.join(workspaceRoot, BACKSTAGE_JSON),
|
||||
|
||||
Reference in New Issue
Block a user