Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape patterns script not working correctly #154

Open
MaggieCabrera opened this issue Mar 26, 2024 · 2 comments
Open

Escape patterns script not working correctly #154

MaggieCabrera opened this issue Mar 26, 2024 · 2 comments

Comments

@MaggieCabrera
Copy link
Collaborator

MaggieCabrera commented Mar 26, 2024

While working on #152 I tried to use the escape patterns script and it was failing:


> [email protected] patterns:escape
> node ./theme-utils.mjs escape-patterns

╔══════════════════════════════════════════╗
║              THEME: poetry               ║
║                                          ║
║  Following patterns may get updated with ║
║    escaped strings and/or image paths    ║
╟──────────────────────────────────────────╢
║ poetry/patterns/posts.php                ║
╟──────────────────────────────────────────╢
║ poetry/patterns/index.php                ║
╚══════════════════════════════════════════╝

? Verify the theme slug poetry
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open 'poetry/patterns/index.php'
Emitted 'error' event on ReadStream instance at:
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'poetry/patterns/index.php'
}
@joanrodas
Copy link

This error seems to happen when you delete or rename a file from the patterns folder without commiting to git. If you change the file contents and run the command, the script seems to work fine.
Captura de pantalla de 2024-04-05 19-59-01

Steps to reproduce error:

  1. Delete or rename a pattern file (for example poetry/index.php)
  2. Run npm run patterns:escape

@MaggieCabrera
Copy link
Collaborator Author

@joanrodas I can avoid the error if I don't rename the file but it still doesn't escape the strings, so the script still needs some debugging apparently. Thanks for your help!

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

No branches or pull requests

2 participants