zarro 1.170.16 → 1.170.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -815,7 +815,7 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
|
|
|
815
815
|
if (!`${opts.id}`.trim()) {
|
|
816
816
|
throw new Error(`package id not specified`);
|
|
817
817
|
}
|
|
818
|
-
const args = ["add", "package", opts.
|
|
818
|
+
const args = ["add", opts.projectFile, "package", opts.id];
|
|
819
819
|
pushIfSet(args, opts.version, "--version");
|
|
820
820
|
pushIfSet(args, opts.framework, "--framework");
|
|
821
821
|
pushFlag(args, opts.noRestore, "--no-restore");
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
const ver = other instanceof Version
|
|
68
68
|
? other
|
|
69
69
|
: new Version(other);
|
|
70
|
-
return
|
|
70
|
+
return compareVersions(this.version, this.tag, ver.version, ver.tag);
|
|
71
71
|
}
|
|
72
72
|
toString() {
|
|
73
73
|
const ver = this.version.join(".");
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
: ver;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function compareVersions(x, xTag, y, yTag) {
|
|
80
80
|
const shortest = Math.min(x.length, y.length), compare = [];
|
|
81
81
|
for (let i = 0; i < shortest; i++) {
|
|
82
82
|
if (x[i] > y[i]) {
|
|
@@ -90,11 +90,11 @@
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
if (compare.length === 0) {
|
|
93
|
-
return
|
|
93
|
+
return compareTags(xTag, yTag);
|
|
94
94
|
}
|
|
95
95
|
const allZero = compare.reduce((acc, cur) => acc && (cur === "0"), true);
|
|
96
96
|
if (allZero) {
|
|
97
|
-
return
|
|
97
|
+
return compareTags(xTag, yTag);
|
|
98
98
|
}
|
|
99
99
|
for (const s of compare) {
|
|
100
100
|
if (s === ">") {
|
|
@@ -104,7 +104,29 @@
|
|
|
104
104
|
return -1;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
+
return compareTags(xTag, yTag);
|
|
108
|
+
}
|
|
109
|
+
function compareTags(xTag, yTag) {
|
|
110
|
+
if (xTag && yTag) {
|
|
111
|
+
return compareStrings(xTag, yTag);
|
|
112
|
+
}
|
|
113
|
+
if (xTag) {
|
|
114
|
+
// assume x is the beta for y
|
|
115
|
+
return -1;
|
|
116
|
+
}
|
|
117
|
+
if (yTag) {
|
|
118
|
+
// assume y is the beta for x
|
|
119
|
+
return 1;
|
|
120
|
+
}
|
|
107
121
|
return 0;
|
|
108
122
|
}
|
|
123
|
+
function compareStrings(s1, s2) {
|
|
124
|
+
if (s1 === s2) {
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
127
|
+
return s1 < s2
|
|
128
|
+
? -1
|
|
129
|
+
: 1;
|
|
130
|
+
}
|
|
109
131
|
module.exports = Version;
|
|
110
132
|
})();
|
package/package.json
CHANGED