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:
MT Lewis
2024-12-16 17:53:35 +00:00
committed by GitHub
2 changed files with 9 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'yarn-plugin-backstage': minor
---
Fixed windows path resolution on windows
+4 -2
View File
@@ -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),