Skip to content

fix: ajuste no workflow para dist no npm#16

Merged
cleberhensel merged 3 commits into
mainfrom
fix/relase-workflow
Oct 24, 2025
Merged

fix: ajuste no workflow para dist no npm#16
cleberhensel merged 3 commits into
mainfrom
fix/relase-workflow

Conversation

@cleberhensel
Copy link
Copy Markdown
Contributor

This pull request introduces important safety improvements to the CLI install and update commands, preventing accidental operations in critical system directories. It also refactors the directory hashing logic in the conflict detector for improved reliability.

Critical system directory protection:

  • Added checks in both installCommand and updateCommand (in apps/cli/src/commands/install.ts and apps/cli/src/commands/update.ts) to block execution if the current working directory is a critical system path (e.g. /, /usr, /etc, etc.), with clear error messages for users. [1] [2]

Codebase consistency:

  • Removed redundant assignment of projectRoot after introducing the new critical path check, ensuring that only the resolved and validated project root is used. [1] [2]

Directory hashing reliability:

  • Updated the directory hashing logic in ConflictDetector (apps/cli/src/stash/conflict-detector.ts) to use Node's crypto module for generating a SHA-256 hash, ensuring consistent and secure hash values for directories.
  • Added missing import for the crypto module to support the new hashing implementation.

cursor[bot]

This comment was marked as outdated.

…otection

- Create safe-paths utility with platform-specific critical path detection
- Support Windows (C:\, C:\Windows, C:\Program Files, etc)
- Support macOS (/, /System, /Library, /Applications, etc)
- Support Linux (/, /usr, /etc, /var, /root, etc)
- Refactor install and update commands to use new utility
- Add comprehensive test suite (11 tests covering all platforms)

Fixes: POSIX path handling that failed on Windows
@cleberhensel cleberhensel merged commit 914bbd4 into main Oct 24, 2025
5 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.

1 participant