-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRepositoryActions.json
179 lines (172 loc) · 7.09 KB
/
RepositoryActions.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Define your repository context actions for RepoZ with this file (changes require an app restart).
# COMMUNITY
# ==========
#
# Please visit the following repository to find help, ask questions and browse repository actions
# for 3rd party apps others might already have posted:
#
# https://github.com/awaescher/RepoZ-RepositoryActions
# Don't forget to leave a star ;)
#
# If you have created your own repository actions, please consider to share them with the community
# by submitting a pull-request.
#
# Thank you <3
# HOW TO USE
# ===========
#
# This file can be used to define repository actions and actions based on the file extensions inside of given repositories,
# so called file associations.
# Let's start ...
#
# Repository actions
# ------------------
#
# Repository actions are actions for the repository context menu in RepoZ. They always refer to the repository they are invoked with.
# Each repository action is defined in an own json block defining its name, action on invocation and more.
#
# Example
# {
# "name": "Open in Visual Studio Code",
# "command": 'code',
# "executables":
# [
# '%LocalAppData%/Programs/Microsoft VS Code/code.exe',
# '%ProgramW6432%/Microsoft VS Code/code.exe'
# ],
# "arguments": '"{Repository.SafePath}"',
# "keys": "Ctrl+Shift+C",
# "active": "true"
# }
#
# Use either 'command' or 'executables'. If both are defined, 'command' will always be preferred.
#
# - Commands will not be validated, RepoZ is going to execute it blindly with the given arguments.
# This is useful for system commands like 'start' on Windows or 'open' on macOS or other global command line tools.
# - Executables will be validated with File.Exists() and might not be visible in RepoZ if none of the defined executables are available.
# This is useful if an application is known to be located in different folders (like Visual Studio Code) and require probing.
#
# Try to avoid absolute paths if possible by using environment variables like %PROGRAMFILES% or %APPDATA%, for example.
# On Windows: Run 'SET' in cmd.exe to see the list of environment variables you can use.
#
# Use the placeholders below to build repository actions with information of the corresponding repository.
# RepoZ will replace the placeholders automatically.
#
# PLACEHOLDER EXAMPLE
# {Repository.Name} RepoZ
# {Repository.Path} (prefer SafePath) C:\Develop\RepoZ\ (Windows) or /Users/awaescher/Developer/RepoZ/ (macOS)
# {Repository.Location} C:\Develop (Windows) or /Users/awaescher/Developer (macOS)
# {Repository.SafePath} C:/Develop/RepoZ (Windows) or /Users/awaescher/Developer/RepoZ (macOS)
# {Repository.CurrentBranch} feature/CustomizableContextMenu
# {Repository.Branches} master|feature/CustomizableContextMenu|origin/HEAD|origin/master|origin/feature/CustomizableContextMenu
# {Repository.LocalBranches} master|feature/CustomizableContextMenu
# {Repository.RemoteUrls} https://github.com/awaescher/repoz
#
#
# File associations
# ------------------
#
# File associations are different to repository actions. They are not related to the repository itself but define a file pattern
# like "*.sln" which RepoZ uses to scan for files recursively. Matching files will be listed in a separate sub menu named after
# the file association itself.
# File associations don't support the repository placeholders from above. The only placeholder is the path of the matching files
# which can be referred to as {FilePath}.
#
# Example
# {
# "name": "Open Visual Studio solutions",
# "extension": "*.sln",
# "command": 'start',
# "arguments": '"{FilePath}"',
# "active": "true"
# }
#
# NOTEWORTHY
# ===========
#
# - {Repository.Path}, {Repository.SafePath} and {Repository.Location} will NOT be wrapped in quotes by default, because some apps require different escape characters.
# - The first action will automatically get the Shortcut [Return], the second [Ctrl+Return]/[Command+Return] in addition to the shortcuts defined.
# - Recursive file scans for the file associations might be time consuming. Therefore, RepoZ will not scan for files unless the sub menu
# of the corresponding file association gets expanded. This way, RepoZ makes sure that the context menu won't become sluggish.
{
"repository-actions":
[
{
"name": "Open in Windows File Explorer",
"command": '"{Repository.SafePath}"',
"keys": "Ctrl+E",
"active": "true"
},
{
"name": "Open in Windows Terminal",
"command": 'wt',
"arguments": '-d "{Repository.SafePath}"',
"keys": "Ctrl+T",
"active": "true"
},
{
"name": "Open in Windows Command Shell",
"command": 'cmd',
"arguments": '/K "cd /d {Repository.SafePath}"',
"active": "false"
},
{
"name": "Open in Windows PowerShell",
"executables": ['%WINDIR%/System32/WindowsPowerShell/v1.0/powershell.exe'],
"arguments": '-executionpolicy bypass -noexit -command "Set-Location \'{Repository.SafePath}\'"',
"active": "false"
},
{
"name": "Open in Visual Studio Code",
"executables":
[
'%LocalAppData%/Programs/Microsoft VS Code/code.exe',
'%ProgramW6432%/Microsoft VS Code/code.exe'
],
"arguments": '"{Repository.SafePath}"',
"active": "true"
},
{
"name": "Open in GitHub Desktop",
"command": 'github',
"arguments": '"{Repository.SafePath}"',
"active": "false"
},
{
# Contributed by Coen van den Munckhof (https://github.com/coenm)
"name": "Open in Sourcetree",
"executables":
[
'%LocalAppData%/SourceTree/SourceTree.exe',
'%PROGRAMFILES(X86)%/Atlassian/SourceTree/SourceTree.exe'
],
"arguments": '-f "{Repository.SafePath}"',
"active": "false"
},
{
# Contributed by Sean Feldman (https://github.com/SeanFeldman)
"name": "Open in Git Extensions",
"executables": ['%PROGRAMFILES(X86)%/GitExtensions/GitExtensions.exe'],
"arguments": 'browse "{Repository.SafePath}"',
"active": "false"
},
{
# Contributed by jods (https://github.com/jods4)
"name": "Open in Cmder",
"command": 'cmder.exe', # make sure Cmder is in PATH (https://github.com/cmderdev/cmder/#installation)
"arguments": '/single /start "{Repository.SafePath}"',
"keys": "Ctrl+Shift+C",
"active": "false"
}
],
"file-associations":
[
{
"name": "Open Visual Studio solutions",
"extension": "*.sln",
"command": 'start',
"arguments": '"{FilePath}"',
"active": "true"
}
]
}