Skip to content

Commit 1fa66e8

Browse files
authored
Handle windows and mac line ending char parsing in docker image files parsing. (#7473)
* changed string to regex in string replace to replace all occurrences. * Fixed same in v1 version * handle \r line ending char in file parsing.
1 parent 0a79e71 commit 1fa66e8

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

Tasks/DockerV0/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 0,
1515
"Minor": 3,
16-
"Patch": 12
16+
"Patch": 13
1717
},
1818
"demands": [],
1919
"preview": "false",

Tasks/DockerV0/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 0,
1515
"Minor": 3,
16-
"Patch": 12
16+
"Patch": 13
1717
},
1818
"demands": [],
1919
"preview": "false",

Tasks/DockerV0/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as imageUtils from "docker-common/containerimageutils";
88
export function getImageNames(): string[] {
99
let imageNamesFilePath = tl.getPathInput("imageNamesPath", /* required */ true, /* check exists */ true);
1010
var enforceDockerNamingConvention = tl.getBoolInput("enforceDockerNamingConvention");
11-
let imageNames = fs.readFileSync(imageNamesFilePath, "utf-8").trim().replace("\r\n", "\n").split("\n");
11+
let imageNames = fs.readFileSync(imageNamesFilePath, "utf-8").trim().replace(/\r\n|\r/gm, "\n").split("\n"); // \r\n windows and \r mac new line chars
1212
if (!imageNames.length) {
1313
throw new Error(tl.loc("NoImagesInImageNamesFile", imageNamesFilePath));
1414
}

Tasks/DockerV1/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 0
16+
"Patch": 1
1717
},
1818
"demands": [],
1919
"preview": "true",

Tasks/DockerV1/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 0
16+
"Patch": 1
1717
},
1818
"demands": [],
1919
"preview": "true",

Tasks/DockerV1/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as imageUtils from "docker-common/containerimageutils";
88
export function getImageNames(): string[] {
99
let imageNamesFilePath = tl.getPathInput("imageNamesPath", /* required */ true, /* check exists */ true);
1010
var enforceDockerNamingConvention = tl.getBoolInput("enforceDockerNamingConvention");
11-
let imageNames = fs.readFileSync(imageNamesFilePath, "utf-8").trim().replace("\r\n", "\n").split("\n");
11+
let imageNames = fs.readFileSync(imageNamesFilePath, "utf-8").trim().replace(/\r\n|\r/gm, "\n").split("\n"); // \r\n windows and \r mac new line chars
1212
if (!imageNames.length) {
1313
throw new Error(tl.loc("NoImagesInImageNamesFile", imageNamesFilePath));
1414
}

0 commit comments

Comments
 (0)