From c835804a172e0139e7a06785c6007e7b451d34d6 Mon Sep 17 00:00:00 2001 From: Andrey Grebenyk <35263631+x318@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:37:57 +0300 Subject: [PATCH] fix(set version) - fix build workflow for windows (#5966) **What's the problem this PR addresses?** Resolves #5670 ... **How did you fix it?** Use windows-native `move` command for win32` platform ... **Checklist** - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). - [x] I have set the packages that need to be released for my changes to be effective. - [x] I will check that all automated PR checks pass before the PR gets reviewed. --- .yarn/versions/21efce51.yml | 7 +++++++ .../sources/commands/set/version/sources.ts | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .yarn/versions/21efce51.yml diff --git a/.yarn/versions/21efce51.yml b/.yarn/versions/21efce51.yml new file mode 100644 index 000000000000..b816f400e8d2 --- /dev/null +++ b/.yarn/versions/21efce51.yml @@ -0,0 +1,7 @@ +releases: + "@yarnpkg/plugin-essentials": patch + +declined: + - "@yarnpkg/plugin-interactive-tools" + - "@yarnpkg/plugin-typescript" + - "@yarnpkg/cli" diff --git a/packages/plugin-essentials/sources/commands/set/version/sources.ts b/packages/plugin-essentials/sources/commands/set/version/sources.ts index 66ef540e3799..dc38915c1d06 100644 --- a/packages/plugin-essentials/sources/commands/set/version/sources.ts +++ b/packages/plugin-essentials/sources/commands/set/version/sources.ts @@ -9,6 +9,7 @@ import {getAvailablePlugins} import {setVersion} from '../version'; const PR_REGEXP = /^[0-9]+$/; +const IS_WIN32 = process.platform === `win32`; function getBranchRef(branch: string) { if (PR_REGEXP.test(branch)) { @@ -33,7 +34,7 @@ const updateWorkflow = ({branch}: {branch: string}) => [ const buildWorkflow = ({plugins, noMinify}: {noMinify: boolean, plugins: Array}, output: PortablePath, target: PortablePath) => [ [`yarn`, `build:cli`, ...new Array().concat(...plugins.map(plugin => [`--plugin`, ppath.resolve(target, plugin as Filename)])), ...noMinify ? [`--no-minify`] : [], `|`], - [`mv`, `packages/yarnpkg-cli/bundles/yarn.js`, npath.fromPortablePath(output), `|`], + [IS_WIN32 ? `move` : `mv`, `packages/yarnpkg-cli/bundles/yarn.js`, npath.fromPortablePath(output), `|`], ]; // eslint-disable-next-line arca/no-default-export