feat: added config options to change what code editor will be opened based on the files inside #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have several projects that need to be opened in different code editors. Some I need in VSCode, some in Xcode and some in Android Studio. I tweaked the script a bit on my local machine to check the file extensions inside the folder and determine what editor to use based on that.
My config code looks like this:
In this case iOS projects get opened in Xcode, projects with a gradle file in them in Android Studio and all others in VSCode.
It only searches the top level to keep up performance and make sure some file nested deep in the folder doesn't accidentally match. Order of the list matters, once a match has been found the script will continue and won't check the other options.
I think the performance impact is minimal, but I am testing this on a M2 Macbook Pro so my observations are probably skewed.