Skip to content

Commit

Permalink
fix(set version) - fix build workflow for windows (#5966)
Browse files Browse the repository at this point in the history
**What's the problem this PR addresses?**
<!-- Describe the rationale of your PR. -->
<!-- Link all issues that it closes. (Closes/Resolves #xxxx.) -->
Resolves #5670

...

**How did you fix it?**
<!-- A detailed description of your implementation. -->
Use windows-native `move` command for win32` platform
...

**Checklist**
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).

<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.

<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
  • Loading branch information
x318 authored Nov 13, 2023
1 parent e6f50ad commit c835804
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .yarn/versions/21efce51.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
releases:
"@yarnpkg/plugin-essentials": patch

declined:
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/cli"
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -33,7 +34,7 @@ const updateWorkflow = ({branch}: {branch: string}) => [

const buildWorkflow = ({plugins, noMinify}: {noMinify: boolean, plugins: Array<string>}, output: PortablePath, target: PortablePath) => [
[`yarn`, `build:cli`, ...new Array<string>().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
Expand Down

0 comments on commit c835804

Please sign in to comment.