Skip to content

Comments

fix: throw explicit error if no input was provided for redirect#4297

Closed
maguroid wants to merge 5 commits intoyarnpkg:masterfrom
maguroid:fix/add-passthrough-func
Closed

fix: throw explicit error if no input was provided for redirect#4297
maguroid wants to merge 5 commits intoyarnpkg:masterfrom
maguroid:fix/add-passthrough-func

Conversation

@maguroid
Copy link

@maguroid maguroid commented Mar 30, 2022

What's the problem this PR addresses?

package script fail to "The "file" argument must be of type string. Received undefined" when script start with ">" symbol.

Fixes #3986

How did you fix it?

Checking if redirection have input. If no input was passed, throw error.

Checklist

  • I have read the Contributing Guide.

  • I have set the packages that need to be released for my changes to be effective.

  • I will check that all automated PR checks pass before the PR gets reviewed.

@maguroid
Copy link
Author

maguroid commented Apr 1, 2022

I need to fix this code to be available on subshell case (e.g. (echo 'hello world') > test.text)...
I'm thinking about any good idea.

@maguroid maguroid changed the title fix: add __ysh_passthrough function fix: throw explicit error if no input was provided for redirect Apr 6, 2022
@maguroid
Copy link
Author

maguroid commented Apr 6, 2022

@arcanis
Hi. thank you for helping the other day.
I made a PR. Could you review this code? And I'm wondering what version need to be select in yarn version check -i

You may be busy. If so, then please tell me how I should ask someone to review.

});
});

describe(`>>`, () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the test.text file?

Comment on lines +1 to +2
undecided:
- "@yarnpkg/shell"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this should probably be minor on shell and the CLI, declining the rest.

@maguroid maguroid closed this Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: The "file" argument must be of type string. Received undefined

2 participants