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

feat: added config options to change what code editor will be opened based on the files inside #4

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

CollinHemeltjen
Copy link

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:

xed=.xcodeproj,.xcworkspace
studio=.gradle
code=*

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.

@oe oe merged commit 228ce15 into oe:main Apr 28, 2023
@oe
Copy link
Owner

oe commented Apr 28, 2023

Great PR!
But storing config in a file is not a good idea, I'd like to take advantage of alfred's workflow configurations.

I'll merge this first, then make some minor changes and do a final release. Stay tuned.

oe pushed a commit that referenced this pull request Apr 28, 2023
@oe
Copy link
Owner

oe commented Apr 28, 2023

I've made a few improvements:

  1. support comments in configuration
  2. support case-insensitive compare in `parseEditorCliConfig
  3. improve performance

You don't use a file to store config, sorry for my mistake.

I'm going on holiday, I'll make a final release when I'm back.

@CollinHemeltjen
Copy link
Author

Awesome, improvements look good 🙌

@oe
Copy link
Owner

oe commented May 21, 2023

It has been released in v1.0.3, can be updated from the Afred Gallery.

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.

None yet

2 participants