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

Is there a way to asign the stream to a variable? #3

Open
ganlanyuan opened this issue Mar 17, 2017 · 8 comments
Open

Is there a way to asign the stream to a variable? #3

ganlanyuan opened this issue Mar 17, 2017 · 8 comments

Comments

@ganlanyuan
Copy link

No description provided.

@rask
Copy link
Owner

rask commented Mar 17, 2017

Please elaborate, do you want to read a YAML file in your Gulpfile into a variable while running a task?

@ganlanyuan
Copy link
Author

Yes, I need pase the yaml file as a variable to another task.
I can transfer yaml to json, and get the data as a variable from json file, but that's one more step and also get an unnecessary json file.
If you can help, that will be great!
Thanks

@rask
Copy link
Owner

rask commented Mar 17, 2017

So in essence you have Task 1 that reads a YAML and the YAML should be available to a Task 2?

I think this is bad practise and you should just read the YAML again in Task 2, as the Task 2 might sometimes run without Task 1 running before it, which might break the system.

If you just need to read YAML config to be a global config for all tasks then there are libraries for that.

@ganlanyuan
Copy link
Author

ganlanyuan commented Mar 17, 2017

Sorry I didn't make it clear.
Actually I want to get the variable within the same task, not another task.

If you just need to read YAML config to be a global config for all tasks then there are libraries for that.

It's just JavaScript data, not for configuration.

@rask
Copy link
Owner

rask commented Mar 17, 2017

I see, so first you'd read the YAML data, then use the YAML data in a following pipe step? I quite certain there already was a Gulp plugin for this but I'll see whether I have the time to see how this could be implemented. If you have any ideas then please do create a pull request. :)

@ganlanyuan
Copy link
Author

I see, so first you'd read the YAML data, then use the YAML data in a following pipe step?

Yes.
I searched, but couldn't find a good solution.

@rask
Copy link
Owner

rask commented Mar 20, 2017

I can try to find some time to see how to implement this neatly, no promises. Please, let me know if you stumble upon a solution that works for you so I can see how they have implemented it. :)

@ganlanyuan
Copy link
Author

ganlanyuan commented Mar 21, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants