File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed
Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 175175 <x : String x : Key =" Text.Configure.CommitMessageTemplate.Name" xml : space =" preserve" >Template Name:</x : String >
176176 <x : String x : Key =" Text.Configure.CustomAction" xml : space =" preserve" >CUSTOM ACTION</x : String >
177177 <x : String x : Key =" Text.Configure.CustomAction.Arguments" xml : space =" preserve" >Arguments:</x : String >
178- <x : String x : Key =" Text.Configure.CustomAction.Arguments.Tip" xml : space =" preserve" >Built-in parameters:
179-
178+ <x : String x : Key =" Text.Configure.CustomAction.Arguments.Tip" xml : space =" preserve" >Built-in parameters:
179+
180180 ${REPO} Repository's path
181+ ${DIRNAME} - repository's directory name;
181182 ${REMOTE} Selected remote or selected branch's remote
182183 ${BRANCH} Selected branch, without ${REMOTE} part for remote branches
183184 ${BRANCH_FRIENDLY_NAME} Friendly name of selected branch, contains ${REMOTE} part for remote branches
Original file line number Diff line number Diff line change 180180 <x : String x : Key =" Text.Configure.CustomAction" xml : space =" preserve" >自定义操作</x : String >
181181 <x : String x : Key =" Text.Configure.CustomAction.Arguments" xml : space =" preserve" >命令行参数 :</x : String >
182182 <x : String x : Key =" Text.Configure.CustomAction.Arguments.Tip" xml : space =" preserve" >内置变量:
183-
183+
184184 ${REPO} 仓库路径
185+ ${DIRNAME} 仓库文件夹名
185186 ${REMOTE} 选中的远程仓库或选中分支所属的远程仓库
186187 ${BRANCH} 选中的分支,对于远程分支不包含远程名
187188 ${BRANCH_FRIENDLY_NAME} 选中的分支,对于远程分支包含远程名
Original file line number Diff line number Diff line change 179179 <x : String x : Key =" Text.Configure.CommitMessageTemplate.Name" xml : space =" preserve" >範本名稱:</x : String >
180180 <x : String x : Key =" Text.Configure.CustomAction" xml : space =" preserve" >自訂動作</x : String >
181181 <x : String x : Key =" Text.Configure.CustomAction.Arguments" xml : space =" preserve" >指令參數:</x : String >
182- <x : String x : Key =" Text.Configure.CustomAction.Arguments.Tip" xml : space =" preserve" >內建參數:
183-
182+ <x : String x : Key =" Text.Configure.CustomAction.Arguments.Tip" xml : space =" preserve" >內建參數:
183+
184184 ${REPO} 存放庫路徑
185+ ${DIRNAME} 存放庫資料夾名
185186 ${REMOTE} 所選的遠端存放庫或所選分支的遠端
186187 ${BRANCH} 所選的分支。對於遠端分支,不包含遠端名稱
187188 ${BRANCH_FRIENDLY_NAME} 所選的分支。對於遠端分支,不包含遠端名稱
Original file line number Diff line number Diff line change @@ -179,6 +179,7 @@ private void PrepareControlParameters()
179179 private string PrepareStringByTarget ( string org )
180180 {
181181 org = org . Replace ( "${REPO}" , GetWorkdir ( ) ) ;
182+ org = org . Replace ( "${DIRNAME}" , GetWorkdirname ( ) ) ;
182183
183184 return Target switch
184185 {
@@ -195,6 +196,11 @@ private string GetWorkdir()
195196 return OperatingSystem . IsWindows ( ) ? _repo . FullPath . Replace ( "/" , "\\ " ) : _repo . FullPath ;
196197 }
197198
199+ private string GetWorkdirname ( )
200+ {
201+ return _repo . FullPath . Replace ( "\\ " , "/" ) . Split ( '/' ) [ ^ 1 ] ;
202+ }
203+
198204 private void Run ( string args )
199205 {
200206 var start = new ProcessStartInfo ( ) ;
You can’t perform that action at this time.
0 commit comments