Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
Fix token prefix not as token prefix (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
qetza committed Apr 16, 2020
1 parent 73845fc commit f60ddbe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ If you want to use tokens in XML based configuration files to be replaced during
- replace tokens in your updated configuration file

## Release notes
**New in 3.5.2**
- Fix issue when token prefix present but not as a token prefix ([#149](https://github.com/qetza/vsts-replacetokens-task/issues/149)).

**New in 3.5.1**
- Fix issue when variable `System.ServerType` is not defined ([#147](https://github.com/qetza/vsts-replacetokens-task/issues/147)).

Expand Down
2 changes: 1 addition & 1 deletion task/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ async function run() {
// initialize task
let escapedTokenPrefix: string = tokenPrefix.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
let escapedTokenSuffix: string = tokenSuffix.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
let regex: RegExp = new RegExp(escapedTokenPrefix + '\\s*((?:(?!\\s*' + escapedTokenSuffix + ').)*)\\s*' + escapedTokenSuffix, 'gm');
let regex: RegExp = new RegExp(escapedTokenPrefix + '\\s*((?:(?!' + escapedTokenPrefix + ')(?!\\s*' + escapedTokenSuffix + ').)*)\\s*' + escapedTokenSuffix, 'gm');
logger.debug('pattern: ' + regex.source);

// set telemetry data
Expand Down
2 changes: 1 addition & 1 deletion task/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 3,
"Minor": 5,
"Patch": 1
"Patch": 2
},
"instanceNameFormat": "Replace tokens in $(targetFiles)",
"minimumAgentVersion": "2.105.0",
Expand Down
2 changes: 1 addition & 1 deletion vss-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "replacetokens",
"name": "Replace Tokens",
"version": "3.5.1",
"version": "3.5.2",
"public": true,
"publisher": "qetza",
"targets": [
Expand Down

0 comments on commit f60ddbe

Please sign in to comment.