fix: wrong usage of fslib causes wrong paths to be used on windows

Signed-off-by: davidgiga1993 <davidgiga1993@gmail.com>
This commit is contained in:
davidgiga1993
2024-12-16 11:22:56 +01:00
parent d871eb618f
commit ee49cb4af9
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),