zarro 1.208.0 → 1.208.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.
@@ -26,7 +26,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  gulp.task("build", "Builds Visual Studio solutions in tree", ["prebuild"], tryBuild);
27
27
  gulp.task("quick-build", "Quick build without pre-cursors", tryBuild);
28
28
  async function tryBuild() {
29
- return tryDo(build, "BUILD_RETRIES", e => console.error(chalk.red(`Build fails: ${e}`)), () => console.log(chalk.magentaBright(`Build fails! If the error looks transient, I suggest setting the environment variable 'BUILD_RETRIES' to some number > 0 🔨.`)));
29
+ return tryDo(build, "BUILD_RETRIES", e => console.error(chalk.red(`Build fails: ${e}`)), e => console.log(chalk.magentaBright(`
30
+ Build fails!
31
+
32
+ ${e}
33
+
34
+ If the error looks transient, I suggest setting the environment
35
+ variable 'BUILD_RETRIES' to some number > 0
36
+ `.trim())));
30
37
  }
31
38
  async function build() {
32
39
  const slnMasks = resolveMasks(env.BUILD_INCLUDE, [env.BUILD_EXCLUDE, env.BUILD_ADDITIONAL_EXCLUDE]);
@@ -293,10 +293,6 @@
293
293
  if (fileExistsSync(name)) {
294
294
  return (readTextFileSync(name) || "").trim();
295
295
  }
296
- else {
297
- const { lsSync } = require("yafs");
298
- const files = lsSync(process.cwd());
299
- }
300
296
  }
301
297
  function resolveInternal(name, ignoreDefault, overrideDefault) {
302
298
  if (Array.isArray(name)) {
@@ -82,9 +82,21 @@
82
82
  when: overrideWhenSmaller
83
83
  });
84
84
  function overrideWhenSmaller(existing, override) {
85
+ if (!override) {
86
+ return false;
87
+ }
88
+ if (!existing) {
89
+ return true;
90
+ }
85
91
  const existingNumber = parseInt(`${existing}`, 10);
86
92
  const overrideNumber = parseInt(`${override}`, 10);
87
93
  if (isNaN(existingNumber) || isNaN(overrideNumber)) {
94
+ if (!isNaN(existingNumber)) {
95
+ return false;
96
+ }
97
+ if (!isNaN(overrideNumber)) {
98
+ return true;
99
+ }
88
100
  throw new ZarroError(`Can't determine if override '${override}' should take precedence over '${existing}'`);
89
101
  }
90
102
  const result = overrideNumber < existingNumber;
@@ -30,7 +30,7 @@
30
30
  else {
31
31
  if (requestedRetries < 1) {
32
32
  if (onFinalFailure) {
33
- await onFinalFailure();
33
+ await onFinalFailure(e);
34
34
  }
35
35
  else {
36
36
  console.log(chalk.magentaBright(`Failed after ${totalAttempts} attempts`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zarro",
3
- "version": "1.208.0",
3
+ "version": "1.208.2",
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"
package/types.d.ts CHANGED
@@ -149,7 +149,7 @@ declare global {
149
149
  logic: AsyncVoidFunc<T>,
150
150
  retries: number | string,
151
151
  onTransientError?: ErrorReporter,
152
- onFinalFailure?: VoidVoid
152
+ onFinalFailure?: ((e: Error) => void) | ((e: Error) => Promise<void>)
153
153
  ) => Promise<T>;
154
154
  type Optional<T> = T | undefined;
155
155
  type Nullable<T> = T | null;