You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# throw and let the caller handle the error since it'll have access to the
63
-
# filename of the file with the malformed line for reporting
64
-
throw
65
-
}
66
-
$this.id=$split[0]
67
-
$this.depVer=$split[1]
68
-
if ($split.Count-eq3)
69
-
{
70
-
$this.curVer=$split[2]
71
-
}
66
+
$split=$inputString.Split(";")
67
+
if (($split.Count-ne3) -and ($split.Count-ne2))
68
+
{
69
+
# throw and let the caller handle the error since it'll have access to the
70
+
# filename of the file with the malformed line for reporting
71
+
throw
72
+
}
73
+
$this.id=$split[0]
74
+
$this.depVer=$split[1]
75
+
if ($split.Count-eq3)
76
+
{
77
+
$this.curVer=$split[2]
78
+
}
72
79
}
73
80
}
74
81
@@ -78,22 +85,22 @@ function Build-Dependency-Hash-From-File {
78
85
[string]$depFile)
79
86
foreach($lineinGet-Content$depFile)
80
87
{
81
-
if (!$line-or$line.Trim() -eq''-or$line.StartsWith("#"))
88
+
if (!$line-or$line.Trim() -eq''-or$line.StartsWith("#"))
89
+
{
90
+
continue
91
+
}
92
+
try {
93
+
[Dependency]$dep= [Dependency]::new($line)
94
+
if ($depHash.ContainsKey($dep.id))
82
95
{
83
-
continue
84
-
}
85
-
try {
86
-
[Dependency]$dep= [Dependency]::new($line)
87
-
if ($depHash.ContainsKey($dep.id))
88
-
{
89
-
Write-Host"Error: Duplicate dependency encountered. '$($dep.id)' defined in '$($depFile)' already exists in the dependency list which means it is defined in multiple version_*.txt files."
90
-
continue
91
-
}
92
-
$depHash.Add($dep.id,$dep)
93
-
}
94
-
catch {
95
-
Write-Host"Invalid dependency line='$($line) in file=$($depFile)"
96
+
Write-Host"Error: Duplicate dependency encountered. '$($dep.id)' defined in '$($depFile)' already exists in the dependency list which means it is defined in multiple version_*.txt files."
97
+
continue
96
98
}
99
+
$depHash.Add($dep.id,$dep)
100
+
}
101
+
catch {
102
+
Write-Host"Invalid dependency line='$($line) in file=$($depFile)"
103
+
}
97
104
}
98
105
}
99
106
@@ -112,7 +119,11 @@ foreach($artifact in $ArtifactsList) {
0 commit comments