Skip to content

Conversation

@zone117x
Copy link
Contributor

The git-info script throws unwanted errors in certain debugging scenarios. It previously had an env var check for NODE_ENV=test to avoid throwing in the context of tests, but this is often not set when debugging in other situations.

This PR keeps that condition, and adds a new condition:

  • If the .git-info file does not exist, and a debugger is not attached, then do not throw.

This is implemented with a lazy-loaded function call and module-load after the .git-info file-not-found error:

const isDebugging = () => require('node:inspector').url() !== undefined';

This PR also exposes this isDebugging helper function because that code is often useful in other projects that use this library.

@zone117x zone117x requested a review from rafaelcr April 17, 2025 07:55
@zone117x zone117x force-pushed the feat/debugging-features branch from 2fcc62a to 13d4019 Compare April 17, 2025 07:57
Copy link
Collaborator

@rafaelcr rafaelcr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zone117x zone117x merged commit 66f44d5 into develop May 7, 2025
1 of 3 checks passed
@zone117x zone117x deleted the feat/debugging-features branch May 7, 2025 05:48
hirosystems-release-bot bot added a commit that referenced this pull request Jun 2, 2025
## [1.9.0](v1.8.0...v1.9.0) (2025-06-02)

### Features

* onceWhen function ([#43](#43)) ([840b2f1](840b2f1))
* onceWhen function ([#43](#43)) ([#44](#44)) ([4013b38](4013b38))
* worker thread pool ([#41](#41)) ([16c9616](16c9616))

### Bug Fixes

* git info check should not throw when debugging ([#39](#39)) ([66f44d5](66f44d5))
@hirosystems-release-bot
Copy link
Contributor

🎉 This PR is included in version 1.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants