zarro 1.182.0 → 1.183.1
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.
|
@@ -507,6 +507,15 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
|
|
|
507
507
|
if (!opts.apiKey) {
|
|
508
508
|
throw new ZarroError("apiKey was not specified");
|
|
509
509
|
}
|
|
510
|
+
const o = opts;
|
|
511
|
+
// the dotnet cli mentions --skip-duplicate, which makes
|
|
512
|
+
// sense for a single package, however, as an outer caller
|
|
513
|
+
// potentially acting on multiple packages will use the
|
|
514
|
+
// pluralized version, and since I've just spent 1/2 an hour
|
|
515
|
+
// figuring this out... let's add some boilerplating.
|
|
516
|
+
if (o.skipDuplicate !== undefined && o.skipDuplicates === undefined) {
|
|
517
|
+
o.skipDuplicates = o.skipDuplicate;
|
|
518
|
+
}
|
|
510
519
|
const args = [
|
|
511
520
|
"nuget",
|
|
512
521
|
"push",
|
|
@@ -525,7 +534,7 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
|
|
|
525
534
|
pushIfSet(args, opts.timeout, "--timeout");
|
|
526
535
|
pushFlag(args, opts.disableBuffering, "--disable-buffering");
|
|
527
536
|
pushFlag(args, opts.noSymbols, "--no-symbols");
|
|
528
|
-
pushFlag(args, opts.
|
|
537
|
+
pushFlag(args, opts.skipDuplicates, "--skip-duplicate");
|
|
529
538
|
pushFlag(args, opts.noServiceEndpoint, "--no-service-endpoint");
|
|
530
539
|
pushFlag(args, opts.forceEnglishOutput, "--force-english-output");
|
|
531
540
|
pushAdditionalArgs(args, opts);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
return !!executable.match(/^dotnet(:?\.exe)?$/i);
|
|
8
8
|
}
|
|
9
9
|
async function pushWithDotnet(opts) {
|
|
10
|
-
await dotnetCli.nugetPush(opts);
|
|
10
|
+
return await dotnetCli.nugetPush(opts);
|
|
11
11
|
}
|
|
12
12
|
async function nugetPush(packageFile, sourceName, options) {
|
|
13
13
|
const nugetPushSource = sourceName ||
|
package/gulp-tasks/nuget-push.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const exec_step_1 = require("exec-step");
|
|
2
4
|
(function () {
|
|
3
5
|
gulp.task("nuget-push", "Pushes the latest versions of packages in the package build dir", async () => {
|
|
4
|
-
const { ctx } = require("exec-step"), 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, {
|
|
6
|
+
const SystemError = requireModule("system-error"), { ctx } = require("exec-step"), 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
7
|
recurse: false,
|
|
6
8
|
entities: FsEntities.files,
|
|
7
9
|
match: versionRe
|
|
@@ -28,7 +30,20 @@
|
|
|
28
30
|
return;
|
|
29
31
|
}
|
|
30
32
|
for (const file of toPush) {
|
|
31
|
-
await ctx.exec(`⬆️ pushing ${file}`, async () =>
|
|
33
|
+
await ctx.exec(`⬆️ pushing ${file}`, async () => {
|
|
34
|
+
const result = await nugetPush(path.join(folder, file));
|
|
35
|
+
if (SystemError.isError(result)) {
|
|
36
|
+
throw result;
|
|
37
|
+
}
|
|
38
|
+
if (SystemError.isResult(result)) {
|
|
39
|
+
const res = result;
|
|
40
|
+
const io = res.stderr.concat(res.stdout);
|
|
41
|
+
const isConflict = io.find(s => s.includes("409"));
|
|
42
|
+
if (isConflict) {
|
|
43
|
+
throw new exec_step_1.ExecStepOverrideMessage(`${path.basename(file)} NOT pushed: this version already exists at the registry.`, new Error('dummy'), false);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
32
47
|
}
|
|
33
48
|
});
|
|
34
49
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zarro",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.183.1",
|
|
4
4
|
"description": "Some glue to make gulp easier, perhaps even zero- or close-to-zero-conf",
|
|
5
5
|
"bin": {
|
|
6
6
|
"zarro": "index.js"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"decompress": "^4.2.1",
|
|
62
62
|
"del": "^5.1.0",
|
|
63
63
|
"event-stream": "^4.0.1",
|
|
64
|
-
"exec-step": "^0.
|
|
64
|
+
"exec-step": "^0.15.0",
|
|
65
65
|
"fancy-log": "^1.3.3",
|
|
66
66
|
"gulp": "^5.0.0",
|
|
67
67
|
"gulp-debug": "^4.0.0",
|
package/types.d.ts
CHANGED
|
@@ -987,7 +987,7 @@ declare global {
|
|
|
987
987
|
|
|
988
988
|
type GitTagFromCsProj = (options?: GitTagOptions) => Stream;
|
|
989
989
|
type GitFetch = (all: boolean) => Promise<void>;
|
|
990
|
-
type NugetPush = (packageFile: string, sourceName?: string, options?: NugetPushOpts) => Promise<
|
|
990
|
+
type NugetPush = (packageFile: string, sourceName?: string, options?: NugetPushOpts) => Promise<SystemError | SystemResult | undefined>;
|
|
991
991
|
|
|
992
992
|
interface ParseNugetVersion {
|
|
993
993
|
parseNugetVersion(versionStringOrFileName: string): Version;
|
|
@@ -1539,7 +1539,7 @@ declare global {
|
|
|
1539
1539
|
symbolApiKey?: string;
|
|
1540
1540
|
disableBuffering?: boolean;
|
|
1541
1541
|
noSymbols?: boolean;
|
|
1542
|
-
|
|
1542
|
+
skipDuplicates?: boolean;
|
|
1543
1543
|
noServiceEndpoint?: boolean;
|
|
1544
1544
|
forceEnglishOutput?: boolean;
|
|
1545
1545
|
source?: string;
|