Unverified Commit 8b9ff610 authored by Hong Minhee's avatar Hong Minhee
Browse files

Debug print on `isCommandAvailable()`

parent 57c05238
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -160,6 +160,12 @@ jobs:
    - run: 'cat "$CHANGES_FILE"'
      env:
        CHANGES_FILE: ${{ steps.extract-changelog.outputs.output-file }}
    - uses: actions/upload-artifact@v4
      with:
        name: dist
        path: |
          src/npm/*.tgz
          cli/fedify-cli-*
    - if: github.event_name == 'push' && github.ref_type == 'tag'
      uses: softprops/action-gh-release@v1
      with:
+2 −1
Original line number Diff line number Diff line
@@ -12,7 +12,8 @@
    ".vscode",
    "fedify-cli-*.tar.xz",
    "fedify-cli-*.tgz",
    "fedify-cli-*.zip"
    "fedify-cli-*.zip",
    "npm"
  ],
  "unstable": [
    "fs",
+11 −3
Original line number Diff line number Diff line
@@ -1278,10 +1278,18 @@ async function isCommandAvailable(
  try {
    const output = await cmd.output();
    const stdout = new TextDecoder().decode(output.stdout);
    logger.debug(
      "The stdout of the command {command} is: {stdout}",
      { command: checkCommand, stdout },
    );
    return outputPattern.exec(stdout.trim()) ? true : false;
  } catch (e) {
    if (e instanceof Deno.errors.NotFound) return false;
    throw e;
  } catch (error) {
    logger.debug(
      "The command {command} failed with the error: {error}",
      { command: checkCommand, error },
    );
    if (error instanceof Deno.errors.NotFound) return false;
    throw error;
  }
}