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 |
Could you help please? Getting the following error in SourceTree while using these scripts and running the custom action:
launch path not accessible
Make sure to make the .sh
file is executable:
chmod u+x commit-using-commitizen-in-new-iterm-window.sh
💯
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!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could you help please? Getting the following error in SourceTree while using these scripts and running the custom action: