Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pipes-functions] Adding new functions for pipes #368

Merged
merged 4 commits into from
Oct 4, 2024

Conversation

pratikmota
Copy link
Contributor

@pratikmota pratikmota commented Oct 4, 2024

Changes:

  1. Adding new pipe function
  2. Adding wait function
  3. Adding append-to-file function
  4. Adding stdin function

Testing:

  • append-to-file
    existing file
    image
    image

    file does not exist then automatically new file is created
    image
    image

  • new and wait pipes
    image

  • how to check stdin ( I assume that it will take user input , but if i use with out it is taking input but getting stuck) (Stdin creates a pipe that reads from os.Stdin.)
    May be i am missing correct use/test of it.
    image

@pratikmota pratikmota marked this pull request as ready for review October 4, 2024 05:13
@refaktor
Copy link
Owner

refaktor commented Oct 4, 2024

Thank you!

cc pipes is a separate command that you call to move to pipes subcontext. Then you don't need do\in do\par or cc .. you just call functions directly like x> echo "Hello" |append-to-file "file.txt".

It would be an improvement if you could you make function that accept file accept rye-file instead of string? echo "Hello" |append-to-file %file.txt

you can test stdin if you create a rye script test.rye where for example do\par pipes { stdin |out } and then call it for example cat somefile.txt |rye test.rye

@refaktor refaktor merged commit 74a2d37 into refaktor:main Oct 4, 2024
7 checks passed
@pratikmota pratikmota deleted the pipes-part-6 branch October 8, 2024 07:56
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.

2 participants