Last active
January 10, 2023 18:57
-
-
Save motin/5896c5b04d039aac48e6a2985d12171b to your computer and use it in GitHub Desktop.
Add as SourceTree custom action: Open in Seperate Window (checked), Script to run `/path/to/commit-using-commitizen-in-new-iterm-window.sh` (this path MUST NOT contain spaces due to long-standing SourceTree bug https://jira.atlassian.com/browse/SRCTREE-2150), Parameters: `$REPO`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run argv | |
set repoPath to (item 1 of argv) | |
tell application "iTerm" | |
set newWindow to (create window with default profile) | |
tell current session of newWindow | |
write text "cd " & quoted form of repoPath & " && npx git-cz" | |
end tell | |
end tell | |
end run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# this wrapper makes sure that $REPO is the only argument | |
# specified in the custom action's Parameters field and is necessary | |
# due to https://jira.atlassian.com/browse/SRCTREEWIN-2291 | |
osascript /path/to/commit-using-commitizen-in-new-iterm-window.scpt $@ | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note to others: Ensure you set permissions for the
.sh
script (as described above) and set the Custom Action settings as described in the Description of this Gist!