zarro 1.170.0 → 1.170.2
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.
- package/gulp-tasks/nuget-push.js +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
(function () {
|
|
3
|
+
gulp.task("nuget-push", "Pushes the latest versions of packages in the package build dir", async () => {
|
|
4
|
+
const debug = requireModule("debug")(__filename), path = require("path"), nugetPush = requireModule("nuget-push"), { ls, FsEntities } = require("yafs"), env = requireModule("env"), folder = env.resolve(env.PACK_TARGET_FOLDER), versionRe = /^(?<id>[A-Za-z\.]+)\.(?<version>\d\.\d\.\d)(-(?<tag>.*))?.nupkg$/, packages = await ls(folder, {
|
|
5
|
+
recurse: false,
|
|
6
|
+
entities: FsEntities.files,
|
|
7
|
+
match: versionRe
|
|
8
|
+
}), sorted = packages.sort().reverse(), seen = new Set();
|
|
9
|
+
for (const file of sorted) {
|
|
10
|
+
const match = file.match(versionRe), id = match === null || match === void 0 ? void 0 : match.groups["id"];
|
|
11
|
+
if (seen.has(id)) {
|
|
12
|
+
debug(`already seen ${id}, skipping ${file}`);
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
seen.add(id);
|
|
16
|
+
await nugetPush(path.join(folder, file));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
})();
|