Skip to content

Comments

fix: check directory exists before cd in npm fact#1489

Merged
Fizzadar merged 1 commit intopyinfra-dev:3.xfrom
KalvadTech:fix-1396
Oct 21, 2025
Merged

fix: check directory exists before cd in npm fact#1489
Fizzadar merged 1 commit intopyinfra-dev:3.xfrom
KalvadTech:fix-1396

Conversation

@wowi42
Copy link
Contributor

@wowi42 wowi42 commented Oct 15, 2025

Previously, the npm fact would fail when the specified directory didn't exist because it attempted to cd into it without checking. This adds a directory existence check using the same pattern as other facts (e.g., git facts).

Fixes #1396

  • Pull request is based on the default branch (3.x at this time)
  • Pull request includes tests for any new/updated operations/facts
  • Pull request includes documentation for any new/updated operations/facts
  • Tests pass (see scripts/dev-test.sh)
  • Type checking & code style passes (see scripts/dev-lint.sh)

Previously, the npm fact would fail when the specified directory didn't exist because it attempted to cd into it without checking. This adds a directory existence check using the same pattern as other facts (e.g., git facts).

Fixes pyinfra-dev#1396
Copy link
Member

@Fizzadar Fizzadar left a comment

Choose a reason for hiding this comment

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

Awesome, thank you for fixing this @wowi42!

@Fizzadar Fizzadar merged commit fb5724f into pyinfra-dev:3.x Oct 21, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Npm package fact fails if directory doesn’t exist

2 participants