zarro 1.99.5 → 1.99.6

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.
@@ -48,11 +48,14 @@ gulp.task(
48
48
  gulp.task("quick-build", "Quick build without pre-cursors", tryBuild);
49
49
 
50
50
  async function tryBuild() {
51
- let totalAttempts = env.resolveNumber("BUILD_RETRIES") + 1;
51
+ const totalRetries = env.resolveNumber("BUILD_RETRIES");
52
+
53
+ // always attempt at least once
54
+ let totalAttempts = totalRetries + 1;
52
55
  if (totalAttempts < 0) {
53
56
  totalAttempts = 1;
54
57
  }
55
- const totalRetries = totalAttempts - 1;
58
+
56
59
  let retryCount = 0;
57
60
 
58
61
  while (totalAttempts-- > 0) {
@@ -60,8 +63,8 @@ async function tryBuild() {
60
63
  await build();
61
64
  } catch (e) {
62
65
  if (totalAttempts > 0) {
63
- console.error(chalk.red(`Build fails: ${e}`));
64
- console.log(chalk.green(`Retrying (${++retryCount} / ${totalRetries })`));
66
+ console.error(chalk.red(`Build fails: ${ e }`));
67
+ console.log(chalk.green(`Retrying (${ ++retryCount } / ${ totalRetries })`));
65
68
  } else {
66
69
  if (totalRetries < 1) {
67
70
  console.log(chalk.magentaBright(`Build fails! If the error looks transient, I suggest setting the environment variable 'BUILD_RETRIES' to some number > 0 🔨.`));
@@ -139,11 +142,18 @@ function buildAsStream(solutions) {
139
142
  nologo: false,
140
143
  logCommand: true,
141
144
  nodeReuse: env.resolveFlag("BUILD_MSBUILD_NODE_REUSE"),
142
- maxcpucount: env.resolveNumber("BUILD_MAX_CPU_COUNT")
145
+ maxcpucount: env.resolveNumber("BUILD_MAX_CPU_COUNT"),
143
146
  };
144
147
 
145
148
  if (env.resolveFlag("BUILD_SHOW_INFO")) {
146
- logConfig(config, {
149
+ const
150
+ buildRetries = env.resolveNumber("BUILD_RETRIES"),
151
+ retryMessage = buildRetries > 0 ? `yes (${buildRetries})` : `no`;
152
+
153
+ logConfig({
154
+ ...config,
155
+ buildRetries: retryMessage
156
+ }, {
147
157
  toolsVersion: "Tools version",
148
158
  targets: "Build targets",
149
159
  configuration: "Build configuration",
@@ -154,6 +164,7 @@ function buildAsStream(solutions) {
154
164
  architecture: "Build architecture",
155
165
  nodeReuse: "Re-use MSBUILD nodes",
156
166
  maxcpucount: "Max CPUs to use for build",
167
+ buildRetries: "Retry builds"
157
168
  });
158
169
  }
159
170
  return solutions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zarro",
3
- "version": "1.99.5",
3
+ "version": "1.99.6",
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"