Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
oe authored Apr 28, 2022
1 parent 391cc95 commit db73ae8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Search bookmarks in SourceTree and launch them in Alfred.

*Credits*: This is a swift clone of [Alfred_SourceTree](https://github.com/yourtion/Alfred_SourceTree) by [yourtion](https://github.com/yourtion). Due to the latest release of macOS 12.3, python2 has been removed, which broke the original workflow. So I reimplemented this workflow in Swift. It should be much more stable and faster.

## Features
1. support fuzzy search
2. can open repo in your code editor directly by press <kbd>cmd</kbd> + <kbd>enter</kbd>, using VS Code by default, you can [custom it](#specify-your-perferred-code-editor)
3. can reveal repo in find by press <kbd>option</kbd> + <kbd>enter</kbd>


## Install
### Prepare
1. you must have [SourceTree](https://www.sourcetreeapp.com/) installed
Expand All @@ -18,10 +24,16 @@ Search bookmarks in SourceTree and launch them in Alfred.

[download workflow](https://github.com/oe/sourcetree-alfred-workflow/raw/main/SourceTree.alfredworkflow) then click the downloaded file to install

Promotion: using [sourcetree-custom-actions](https://github.com/oe/sourcetree-custom-actions) to add useful actions for SourceTree

## Usage

launch alfred then input `st` and `keyword` separated with a space to search bookmarks, press enter to launch the bookmark in SourceTree.

> press `cmd` + `enter` to reveal the repo in Finder
additionnal:
> select a bookmark, press `cmd` + `enter` to open the repo in your favorite code editor, see [how to custom code editor](#custom-your-perferred-code-editor)
> select a bookmark, press `option` + `enter` to reveal the repo in Finder

## Optimize for Intel Chip Mac
If you are using old Intel Chip Mac, you may experience the unbearable lagging, that's because of Swift JIT Compiler is pretty slow on Intel Chip.
Expand All @@ -33,5 +45,21 @@ You can follow the following steps to compile the workflow script to binary to s
*If you are using Apple Silicon Macs(like M1, M1 Pro), you can also compile the workflow, but only a little bit faster*


## custom your perferred code editor
1. Open Alfred Preferences panel
2. find and click the `SourceTree` in **Wokflows** list
3. click the variable icon *[𝓍]* in the top right to show the variable popup
4. add a variable named `EDITOR_CLI`, set its value to your favorite editor's cli name, such as:
> `subl` for Sublime Text
> `xed` for Xcode

do not remove the variable `PATH`, if your editor cli name not
found, you may edit `PATH` then append its path to existing
value, be aware of the PATH format.

5. click `save` button to save variable settings
6. click the bug 🐞 icon in the top right to show the debug log
7. try yourself, if it works, congratulations; if not, check the debug log, make sure the cli name is existing and correct, and `PATH` contains your cli

## Contributions and Support
I'm new to swift, feel free to make a pull request if you are willing to improve the code quality or its functions.
Binary file modified SourceTree.alfredworkflow
Binary file not shown.

0 comments on commit db73ae8

Please sign in to comment.