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

Commit

Permalink
Fix node5 incompatibility (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
qetza committed Oct 8, 2022
1 parent dd2c2e3 commit 7b178df
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 7 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -95,6 +95,12 @@ 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 4.4.1**
- Task **4.2.1**
- Fix compatibility with node 5.10.1 ([#277](https://github.com/qetza/vsts-replacetokens-task/issues/277)).
- Task **3.10.1**
- Fix compatibility with node 5.10.1 ([#277](https://github.com/qetza/vsts-replacetokens-task/issues/277)).

**New in 4.4.0**
- Task **5.1.0**
- Add support for inline variables ([#252](https://github.com/qetza/vsts-replacetokens-task/issues/252)).
Expand Down
3 changes: 3 additions & 0 deletions tasks/ReplaceTokensV3/README.md
Expand Up @@ -84,6 +84,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.10.1**
- Fix compatibility with node 5.10.1 ([#277](https://github.com/qetza/vsts-replacetokens-task/issues/277)).

**New in 3.10.0**
- Add support for inline variables ([#252](https://github.com/qetza/vsts-replacetokens-task/issues/252)).
- Add support for recursive token replacement in values ([#201](https://github.com/qetza/vsts-replacetokens-task/issues/201)).
Expand Down
5 changes: 3 additions & 2 deletions tasks/ReplaceTokensV3/index.ts
Expand Up @@ -250,8 +250,9 @@ var replaceTokensInString = function (
enableEscape: boolean,
escapeType: string,
counter: Counter,
names: string[] = []): string {
names: string[]): string {

names = names || [];
content = content.replace(regex, (match, name) => {
++counter.Tokens;

Expand Down Expand Up @@ -448,7 +449,7 @@ var replaceTokensInFile = function (
let localCounter: Counter = new Counter();
let content: string = iconv.decode(fs.readFileSync(filePath), encoding);

content = replaceTokensInString(content, regex, transformRegex, options, true, escapeType, localCounter);
content = replaceTokensInString(content, regex, transformRegex, options, true, escapeType, localCounter, []);

// ensure outputPath directory exists
let mkdirSyncRecursive = function (p: string) {
Expand Down
2 changes: 1 addition & 1 deletion tasks/ReplaceTokensV3/task.json
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 3,
"Minor": 10,
"Patch": 0
"Patch": 1
},
"instanceNameFormat": "Replace tokens in $(targetFiles)",
"minimumAgentVersion": "2.105.0",
Expand Down
3 changes: 3 additions & 0 deletions tasks/ReplaceTokensV4/README.md
Expand Up @@ -93,6 +93,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 4.2.1**
- Fix compatibility with node 5.10.1 ([#277](https://github.com/qetza/vsts-replacetokens-task/issues/277)).

**New in 4.2.0**
- Add support for inline variables ([#252](https://github.com/qetza/vsts-replacetokens-task/issues/252)).
- Add support for recursive token replacement in values ([#201](https://github.com/qetza/vsts-replacetokens-task/issues/201)).
Expand Down
5 changes: 3 additions & 2 deletions tasks/ReplaceTokensV4/index.ts
Expand Up @@ -250,8 +250,9 @@ var replaceTokensInString = function (
enableEscape: boolean,
escapeType: string,
counter: Counter,
names: string[] = []): string {
names: string[]): string {

names = names || [];
content = content.replace(regex, (match, name) => {
++counter.Tokens;

Expand Down Expand Up @@ -448,7 +449,7 @@ var replaceTokensInFile = function (
let localCounter: Counter = new Counter();
let content: string = iconv.decode(fs.readFileSync(filePath), encoding);

content = replaceTokensInString(content, regex, transformRegex, options, true, escapeType, localCounter);
content = replaceTokensInString(content, regex, transformRegex, options, true, escapeType, localCounter, []);

// ensure outputPath directory exists
let mkdirSyncRecursive = function (p: string) {
Expand Down
2 changes: 1 addition & 1 deletion tasks/ReplaceTokensV4/task.json
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 4,
"Minor": 2,
"Patch": 0
"Patch": 1
},
"releaseNotes": "Added output variables (breaking change).<br/>Added token pattern dropdown (breaking change).",
"instanceNameFormat": "Replace tokens in $(targetFiles)",
Expand Down
2 changes: 1 addition & 1 deletion vss-extension.json
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1,
"id": "replacetokens",
"name": "Replace Tokens",
"version": "4.4.0",
"version": "4.4.1",
"public": true,
"publisher": "qetza",
"targets": [
Expand Down

0 comments on commit 7b178df

Please sign in to comment.