Commit 271a678a authored by pgd's avatar pgd
Browse files

feat: exit code 1 when EXISTS any failure

Related to: #173
parent 9ce5a38b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@
    "@hongminhee/aitertools": "jsr:@hongminhee/aitertools@^0.6.0",
    "@hugoalh/http-header-link": "jsr:@hugoalh/http-header-link@^1.0.2",
    "@logtape/logtape": "jsr:@logtape/logtape@^0.8.0",
    "@opentelemetry/api": "npm:@opentelemetry/api@^1.9.0",
    "@opentelemetry/semantic-conventions": "npm:@opentelemetry/semantic-conventions@^1.27.0",
    "@phensley/language-tag": "npm:@phensley/language-tag@^1.9.0",
    "@std/assert": "jsr:@std/assert@^0.226.0",
    "@std/async": "jsr:@std/async@^1.0.5",
+6 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ export const command = new Command()
    spinner.text = "Initializing succeeded";
    spinner.succeed();

    let success = true;
    for (let i = 0; i < urls.length; i++) {
      const url = urls[i];
      const spinnerForEachLookup = ora({
@@ -116,6 +117,7 @@ export const command = new Command()
          }
          spinnerForEachLookup.text = `Failed to lookup: ${url}`;
          spinnerForEachLookup.fail();
          success = false;
          continue;
        }
        spinnerForEachLookup.succeed();
@@ -135,7 +137,11 @@ export const command = new Command()
        }
      } catch (_) {
        spinnerForEachLookup.fail();
        success = false;
      }
    }
    await server?.close();
    if (!success) {
      Deno.exit(1);
    }
  });
+39 −0
Original line number Diff line number Diff line
{
  "name": "@fedify/cli",
  "version": "0.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "@fedify/cli",
      "version": "0.0.0",
      "cpu": [
        "x64",
        "arm64"
      ],
      "funding": [
        "https://github.com/sponsors/dahlia"
      ],
      "hasInstallScript": true,
      "license": "MIT",
      "os": [
        "darwin",
        "linux",
        "win32"
      ],
      "dependencies": {
        "@fedify/cli": "file:"
      },
      "bin": {
        "fedify": "run.mjs"
      },
      "engines": {
        "node": ">=18.0.0"
      }
    },
    "node_modules/@fedify/cli": {
      "resolved": "",
      "link": true
    }
  }
}
+3 −0
Original line number Diff line number Diff line
@@ -49,5 +49,8 @@
  "repository": {
    "type": "git",
    "url": "git+https://github.com/dahlia/fedify.git"
  },
  "dependencies": {
    "@fedify/cli": "file:"
  }
}