Skip to content

Commit e124d78

Browse files
committed
Fixes windows set version from file
1 parent ec9034e commit e124d78

File tree

1 file changed

+2
-2
lines changed
  • packages/plugin-essentials/sources/commands/set

1 file changed

+2
-2
lines changed

packages/plugin-essentials/sources/commands/set/version.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default class SetVersionCommand extends BaseCommand {
9898
else if (this.version.match(/^https?:/))
9999
bundleUrl = this.version;
100100
else if (this.version.match(/^\.{0,2}[\\/]/) || npath.isAbsolute(this.version))
101-
bundleUrl = `file://${npath.resolve(this.version)}`;
101+
bundleUrl = `file://${ppath.resolve(npath.toPortablePath(this.version))}`;
102102
else if (semverUtils.satisfiesWithPrereleases(this.version, `>=2.0.0`))
103103
bundleUrl = `https://repo.yarnpkg.com/${this.version}/packages/yarnpkg-cli/bin/yarn.js`;
104104
else if (semverUtils.satisfiesWithPrereleases(this.version, `^0.x || ^1.x`))
@@ -118,7 +118,7 @@ export default class SetVersionCommand extends BaseCommand {
118118
let bundleBuffer: Buffer;
119119
if (bundleUrl.startsWith(filePrefix)) {
120120
report.reportInfo(MessageName.UNNAMED, `Downloading ${formatUtils.pretty(configuration, bundleUrl, FormatType.URL)}`);
121-
bundleBuffer = await xfs.readFilePromise(npath.toPortablePath(bundleUrl.slice(filePrefix.length)));
121+
bundleBuffer = await xfs.readFilePromise(bundleUrl.slice(filePrefix.length) as PortablePath);
122122
} else {
123123
report.reportInfo(MessageName.UNNAMED, `Retrieving ${formatUtils.pretty(configuration, bundleUrl, FormatType.PATH)}`);
124124
bundleBuffer = await httpUtils.get(bundleUrl, {configuration});

0 commit comments

Comments
 (0)