alire-project / alire

Command-line tool from the Alire project and supporting library
GNU General Public License v3.0
278 stars 49 forks source link

Disallow identifiers starting with dots #1076

Closed jklmnn closed 1 year ago

jklmnn commented 2 years ago

I noticed that it is possible to create a crate with a name starting with .:

$ alr init --bin .dot    
Alire needs some user information to initialize the crate author and maintainer,
...
✓ .dot initialized successfully.
$ cd .dot 
$ alr printenv       
ⓘ Synchronizing workspace...
Nothing to update.                                                       

export .DOT_ALIRE_PREFIX="/tmp/.dot"
export ALIRE="True"
...

This leads to an error when trying to export the environment:

$ eval $(alr printenv)
export: not valid in this context: .DOT_ALIRE_PREFIX

Looking at https://github.com/alire-project/alire/pull/350 and that leading underscores are disallowed I suppose this is unintended behaviour.

mosteo commented 2 years ago

Indeed, thanks for the report.