forked from qt-creator/qt-creator
Wizards: Fix regular expressions
Although this is valid JavaScript matching the '.' is not working as expected. The directory always gets messed up by replacing the first character with a dash. Use an alternate regular expression and also ensure the replacement happens globally instead of once as we want to replace all dots by a dash. As at it fix handling of the file suffixes as well. Task-number: QTCREATORBUG-22625 Change-Id: Ide189fe50e29994abfb368e503050b9b413aba9f Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
"iconText": "java",
|
||||
"enabled": "%{JS: value('Plugins').indexOf('Android') >= 0}",
|
||||
|
||||
"options": [ { "key": "ClassName", "value": "%{JS: value('FileName').charAt(0).toUpperCase() + value('FileName').substr(1).replace(/\\.java$/,'')}" } ],
|
||||
"options": [ { "key": "ClassName", "value": "%{JS: value('FileName').charAt(0).toUpperCase() + value('FileName').substr(1).replace(/[.]java$/,'')}" } ],
|
||||
|
||||
"pages" :
|
||||
[
|
||||
|
@@ -14,7 +14,7 @@
|
||||
{ "key": "vcsId", "value": "B.Bazaar" },
|
||||
{ "key": "vcsName", "value": "%{JS: Vcs.displayName('%{vcsId}')}" },
|
||||
{ "key": "SR", "value": "%{JS: '%{Repo}'.substr('%{Repo}'.indexOf(':') + 1) }" },
|
||||
{ "key": "defaultDir", "value": "%{JS: '%{SR}'.substr('%{SR}'.lastIndexOf('/') + 1).replace(/\\./, '-') }"},
|
||||
{ "key": "defaultDir", "value": "%{JS: '%{SR}'.substr('%{SR}'.lastIndexOf('/') + 1).replace(/[.]/g, '-') }"},
|
||||
{ "key": "RevArg", "value": "%{JS: '%{Rev}' !== '' ? '-r' : ''}" },
|
||||
{ "key": "TargetPath", "value": "%{Path}/%{Dir}" }
|
||||
],
|
||||
|
@@ -13,8 +13,8 @@
|
||||
[
|
||||
{ "key": "vcsId", "value": "G.Git" },
|
||||
{ "key": "vcsName", "value": "%{JS: Vcs.displayName('%{vcsId}')}" },
|
||||
{ "key": "SR", "value": "%{JS: '%{Repo}'.replace(/\\.git$/, '') }"},
|
||||
{ "key": "defaultDir", "value": "%{JS: '%{SR}'.substr('%{SR}'.lastIndexOf('/') + 1).replace(/\\./, '-') }"},
|
||||
{ "key": "SR", "value": "%{JS: '%{Repo}'.replace(/[.]git$/, '') }"},
|
||||
{ "key": "defaultDir", "value": "%{JS: '%{SR}'.substr('%{SR}'.lastIndexOf('/') + 1).replace(/[.]/g, '-') }"},
|
||||
{ "key": "branchArg", "value": "%{JS: '%{Branch}' ? '--branch' : '' }" },
|
||||
{ "key": "TargetPath", "value": "%{Path}/%{Dir}" }
|
||||
],
|
||||
|
@@ -14,7 +14,7 @@
|
||||
{ "key": "vcsId", "value": "H.Mercurial" },
|
||||
{ "key": "vcsName", "value": "%{JS: Vcs.displayName('%{vcsId}')}" },
|
||||
{ "key": "SR", "value": "%{JS: '%{Repo}'.substr('%{Repo}'.indexOf(':') + 1) }"},
|
||||
{ "key": "defaultDir", "value": "%{JS: '%{SR}'.substr('%{SR}'.lastIndexOf('/') + 1).replace(/\\./, '-') }"},
|
||||
{ "key": "defaultDir", "value": "%{JS: '%{SR}'.substr('%{SR}'.lastIndexOf('/') + 1).replace(/[.]/g, '-') }"},
|
||||
{ "key": "TargetPath", "value": "%{Path}/%{Dir}" }
|
||||
],
|
||||
|
||||
|
@@ -13,8 +13,8 @@
|
||||
[
|
||||
{ "key": "vcsId", "value": "J.Subversion" },
|
||||
{ "key": "vcsName", "value": "%{JS: Vcs.displayName('%{vcsId}')}" },
|
||||
{ "key": "SR", "value": "%{JS: '%{Repo}'.replace(/\\/trunk$/, '').replace(/\\/$/, '') }"},
|
||||
{ "key": "defaultDir", "value": "%{JS: '%{SR}'.substr('%{SR}'.lastIndexOf('/') + 1).replace(/\\./, '-') }"},
|
||||
{ "key": "SR", "value": "%{JS: '%{Repo}'.replace(/[/]trunk$/, '').replace(/[/]$/, '') }"},
|
||||
{ "key": "defaultDir", "value": "%{JS: '%{SR}'.substr('%{SR}'.lastIndexOf('/') + 1).replace(/[.]/g, '-') }"},
|
||||
{ "key": "TargetPath", "value": "%{Path}/%{Dir}" }
|
||||
],
|
||||
|
||||
|
Reference in New Issue
Block a user