Skip to content

Commit

Permalink
📝 Try to be more clear on the customisation part
Browse files Browse the repository at this point in the history
Change the way to customise the Preferences path
  • Loading branch information
bchatard committed Oct 2, 2019
1 parent 071e170 commit 7402671
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 101 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.js]
indent_size = 2

[*.yml]
indent_size = 2

Expand Down
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ You can also install [alfred-updater](https://github.com/SamVerschueren/alfred-u
- CLion: `clion`;
- DataGrip: `datagrip`;
- GoLand: `goland`;
- IntelliJ Idea: `idea`;
- IntelliJ Idea: `idea` (default to Ultimate Edition, see [customisation to change this](#customisation));
- PhpStorm: `pstorm`;
- PyCharm: `pycharm`;
- PyCharm: `pycharm` (default to Professional Edition, see [customisation to change this](#customisation));
- WebStorm: `wstorm`;
- Rider: [Help wanted](https://github.com/bchatard/alfred-jetbrains/issues/5);
- RubyMine: `rubymine`;
Expand All @@ -56,15 +56,15 @@ You can also install [alfred-updater](https://github.com/SamVerschueren/alfred-u
<summary>Supported versions</summary>
I test with this products/versions:

- AppCode: 2018.3 / 2019.1;
- CLion: 2018.3 / 2019.1;
- DataGrip: 2018.3 / 2019.1;
- GoLand: 2018.3 / 2019.1;
- IntelliJ Idea: 2018.3 / 2019.1;
- PhpStorm: 2018.3 / 2019.1;
- PyCharm: 2018.3 / 2019.1;
- WebStorm: 2018.3 / 2019.1;
- RubyMine: 2018.3 / 2019.1;
- AppCode: 2018.3 / 2019.+;
- CLion: 2018.3 / 2019.+;
- DataGrip: 2018.3 / 2019.+;
- GoLand: 2018.3 / 2019.+;
- IntelliJ Idea: 2018.3 / 2019.+;
- PhpStorm: 2018.3 / 2019.+;
- PyCharm: 2018.3 / 2019.+;
- WebStorm: 2018.3 / 2019.+;
- RubyMine: 2018.3 / 2019.+;

For other versions:

Expand All @@ -75,7 +75,8 @@ For other versions:

## Customisation

- [Product](doc/customisation/product.md)
- [Change Product Edition](doc/customisation/edition.md)
- [Change `bin` name](doc/customisation/bin.md)

Some of JetBrains product are available in different editions (ex: PyCharm - Professional, Edu & Community).
In that case they share the same `bin` / `keyword`, so you need to customise the _Preferences_ folder to retrieve your projects.
Expand All @@ -92,10 +93,6 @@ With keyword `jb` you can access to some actions for this workflow.

Some information are cached for better performance. You can change cache lifetime (see [environment variable](#workflow-environment-variables)). This command flush all cache.

## Known issue

It's an early version

## Workflow Environment Variables

- `jb_product_cache_lifetime`: cache lifetime in seconds for "product data" (application path, bin path etc) [default: 86400 seconds]
Expand Down
24 changes: 24 additions & 0 deletions doc/customisation/bin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Customise `bin` name

This workflow is shipped with "default" `bin` name for the different product. But if you change this default `bin`name, you need to update the workflow configuration.

### How-to

1. Create a JSON file somewhere (in your home folder)
2. This JSON file need to follow the same structure of the _[original configuration file](https://github.com/bchatard/alfred-jetbrains/blob/master/src/products.json)_ (same key).
3. Open the workflow, and go to the workflow configuration window (the icon like this [x])
4. Add new environment variable:
- name: `jb_product_customisation_file`
- value: the path to your JSON file (relative to your home - ex: `/.config/alfred-jetbrains/custom.json`)

Examples:

- Change `bin` name for PhpStorm

```json
{
"PhpStorm": {
"bin": ["pstorm"]
}
}
```
31 changes: 31 additions & 0 deletions doc/customisation/edition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Customise product Edition

JetBrains deliver different edition for some products (actually PyCharm and IntelliJIdea). This workflow works with a default edition for this case:

- for PyCharm, it's the Professional Edition
- for IntelliJIdea, it's the Ultimate Edition

If you work with a different edition you need to customise this workflow.

### How-to

1. Open the workflow, and go to the workflow configuration window (the icon like this [x])
2. Add new environment variable:
- name: `jb_preferences_<product_key>`
- value: the path to your JSON file (relative to your home - ex: `/.config/alfred-jetbrains/custom.json`)

### Product keys

- PyCharm: `pycharm` (so environment variable will be `jb_preferences_pycharm`)
- IntelliJIdea: `intellijidea` (so environment variable will be `jb_preferences_intellijidea`)

### Available _Preferences_

- PyCharm
- `PyCharm` for PyCharm Professional (default)
- `PyCharmCE` for PyCharm Community
- `PyCharmEdu` for PyCharm Edu
- IntelliJIdea
- `IntelliJIdea` for IntelliJ Idea Ultimate Edition (default)
- `IdeaIC` for IntelliJ Idea Community
- `IdeaIE` for IntelliJ Idea Community Educational
51 changes: 0 additions & 51 deletions doc/customisation/product.md

This file was deleted.

52 changes: 37 additions & 15 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
Expand Down Expand Up @@ -333,7 +335,7 @@
<key>uid</key>
<string>04BB4121-6857-40CA-A178-444F805A4609</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
Expand All @@ -342,6 +344,8 @@
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
Expand Down Expand Up @@ -380,7 +384,7 @@
<key>uid</key>
<string>C924EB4E-3A7E-4513-A237-261E1E274B66</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
Expand All @@ -389,6 +393,8 @@
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
Expand Down Expand Up @@ -427,7 +433,7 @@
<key>uid</key>
<string>5820F56E-186F-4CC4-B473-284FECF50653</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
Expand All @@ -436,6 +442,8 @@
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
Expand Down Expand Up @@ -474,7 +482,7 @@
<key>uid</key>
<string>DA238413-3FBD-4358-82B7-988FF9101561</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
Expand All @@ -483,6 +491,8 @@
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
Expand All @@ -502,7 +512,7 @@
<key>runningsubtext</key>
<string>searching project</string>
<key>script</key>
<string>./node_modules/.bin/run-node src/index.js "$1" "IdeaUE"</string>
<string>./node_modules/.bin/run-node src/index.js "$1" "IntelliJIdea"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand All @@ -521,7 +531,7 @@
<key>uid</key>
<string>141026F3-CC2E-4808-BF5B-BC24CCA41438</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
Expand Down Expand Up @@ -582,6 +592,8 @@ fi</string>
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
Expand Down Expand Up @@ -620,7 +632,7 @@ fi</string>
<key>uid</key>
<string>D6B5E6CE-D21B-4175-AB8E-1F2A6ED7A298</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
Expand All @@ -629,6 +641,8 @@ fi</string>
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
Expand All @@ -648,7 +662,7 @@ fi</string>
<key>runningsubtext</key>
<string>searching project</string>
<key>script</key>
<string>./node_modules/.bin/run-node src/index.js "$1" "PyCharmPro"</string>
<string>./node_modules/.bin/run-node src/index.js "$1" "PyCharm"</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
Expand All @@ -667,7 +681,7 @@ fi</string>
<key>uid</key>
<string>9A358188-6F3F-4063-AA6C-5DE6E7102212</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
Expand All @@ -676,6 +690,8 @@ fi</string>
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
Expand Down Expand Up @@ -714,7 +730,7 @@ fi</string>
<key>uid</key>
<string>6DEF14CA-6899-481D-9590-8A6BCC174DEF</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
Expand All @@ -723,6 +739,8 @@ fi</string>
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
Expand Down Expand Up @@ -761,7 +779,7 @@ fi</string>
<key>uid</key>
<string>9A5C474B-A56F-4C12-9723-079CD543C502</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<dict>
<key>config</key>
Expand All @@ -770,6 +788,8 @@ fi</string>
<false/>
<key>alfredfiltersresultsmatchmode</key>
<integer>0</integer>
<key>argumenttreatemptyqueryasnil</key>
<false/>
<key>argumenttrimmode</key>
<integer>0</integer>
<key>argumenttype</key>
Expand Down Expand Up @@ -808,7 +828,7 @@ fi</string>
<key>uid</key>
<string>60D577AB-F9AC-4EAA-83EF-38AA139C8C3F</string>
<key>version</key>
<integer>2</integer>
<integer>3</integer>
</dict>
</array>
<key>readme</key>
Expand Down Expand Up @@ -936,15 +956,17 @@ fi</string>
<string>86400</string>
<key>jb_product_customisation_file</key>
<string></string>
<key>jb_search_customisation_file</key>
<string></string>
<key>jb_project_cache_lifetime</key>
<string>3600</string>
<key>jb_search_customisation_file</key>
<string></string>
</dict>
<key>variablesdontexport</key>
<array>
<string>jb_product_customisation_file</string>
<string>jb_preferences_pycharm</string>
<string>jb_search_customisation_file</string>
<string>jb_preferences_intellijidea</string>
<string>jb_product_customisation_file</string>
</array>
<key>version</key>
<string></string>
Expand Down
Loading

0 comments on commit 7402671

Please sign in to comment.