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

Support Multiple Grunt Files #94

Open
wunderdojo opened this issue Nov 12, 2016 · 9 comments
Open

Support Multiple Grunt Files #94

wunderdojo opened this issue Nov 12, 2016 · 9 comments

Comments

@wunderdojo
Copy link

First off, thanks for writing this, it's a huge help.

I'm wondering if it's possible to add support for multiple grunt files. I often have several projects open each of which has their own grunt tasks defined. In NetBeans I can simply right click on the gruntfile in any project to view and run any of the tasks. With this addon the first gruntfile encountered gets loaded so if I didn't close all of the files from another project, then when I launch Atom I'm restricted to that project's grunt tasks.

I can open each project in a new editor but that gets pretty cumbersome. Being able to do something what you can in NetBeans would be amazing.

@kokarn
Copy link
Owner

kokarn commented Nov 12, 2016

Interesting approach. I've never actually done like that. I quite like the idea of having a single project view for each project and switching between them.

With that said, I don't see why this would be impossible to implement.

We'd have to traverse up from every file you open and somehow build a list that you could choose from and present that. Probably somewhere around here
https://github.com/kokarn/atom-grunt-runner/blob/master/lib/grunt-runner-view.coffee#L79-L81

I don't think I will start work on this anytime soon but a PR is always welcome :)

@wunderdojo
Copy link
Author

Thanks for the quick reply. This is what it looks like in NetBeans. I'll see if I can do anything with it.
netbeans-grunt

@kokarn
Copy link
Owner

kokarn commented Nov 12, 2016

So you open each projects root folder at the same time in Atom? I was thinking you only opened a few files from each project.

@wunderdojo
Copy link
Author

I'm primarily working on a bunch of WordPress plugins. Each one has its own Git repo and a I vagrant tasks that automate the entire release process including uploading the new version to our server; updating the version numbers so that customers get the update notice; etc. In NetBeans I simply have the entire local WP install loaded as a project and then I can hop from plugin to plugin running tasks as needed by clicking on the Gruntfile in that particular plugin. In the screenshot above, if I opened a different folder on the left and clicked on that folder's Gruntfile you would see a different set of available tasks, no need to reload anything.

@kokarn
Copy link
Owner

kokarn commented Nov 13, 2016

Ah, I see. That's quite a bit different from how I work most of the time.

Should work fine tho, just re-triggering the lookup for a Gruntfile from the selected file and upwards should result in you getting the closest one to that file.

@wunderdojo
Copy link
Author

Great, thanks. I'll give it a go this week and see what I can come up with. Really appreciate the help.

@tenKinetic
Copy link
Contributor

tenKinetic commented Nov 29, 2016

I've implemented this in my own fork. Needs a little more work before a pull request could be made though.

I came across this issue because I lost this functionality when I updated today after quite a while. Turns out my previously committed pull request was reverted.

The version I've done this time is a bit different though. Before it was purely to allow switching grunt files when opening a file from a different project folder (and the grunt file was always a the root of the project). This time a project can contain multiple grunt files and the closest one up the hierarchy from the file in question is used.

I've still got to remove some redundant code from the previous version, review my stream of consciousness coding and go about my business for a while to make sure there's no cracks.

Feel free to take lib/grunt-runner-view.coffee from my fork (in the multiple-grunt-files branch) if you want this functionality in the mean time.

@kokarn
Copy link
Owner

kokarn commented Nov 29, 2016

Wow, that's great news man!

Not sure at all why it was reverted, maybe in the shuffle when I got ownership or something.

Looking forward to the update!

@wunderdojo
Copy link
Author

That's awesome, thanks so much for sharing it.

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

No branches or pull requests

3 participants