junyu-w / corgi

Corgi is a command-line workflow manager that helps with your repetitive command usages by organizing them into reusable snippet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Corgi cannot detect snippet with special character in title

hminh0407 opened this issue · comments

Description

I've just figured that corgi does not support snippet title with special characters.

  • If a user create a snippet with special characters in title then it won't work because corgi cannot find its location.
  • User can delete this snippet manually but the snippet title still remain in the list of snippets. And it has to be manually deleted via .corgi/snippets.json

Expectation

  • User can input tile with special characters like (!@#$%^&*) and corgi can still detect it.
  • Or have a validation mechanic to warn the user not to break corgi functionality.
  • Or put a guide in the document about what to be expected for a snippet title

Reproduce step

  • create a snippet with special character in title. Ex: [utills][disk] display disk usage.
  • run any corgi command that trigger the snippet. Ex: corgi describe and choose above snippet from the list
  • corgi will throw error
Error: open .../snippet/[utils][disk]_display_disk_usage.json: no such file or directory
Snippets directory path: .../snippet, check if snippet file exists inside.