hirosystems / clarinet

Write, test and deploy high-quality smart contracts to the Stacks blockchain and Bitcoin.
https://hiro.so/clarinet
GNU General Public License v3.0
290 stars 129 forks source link

Creating a new Clarinet project in the local folder breaks devnet #1480

Closed MarvinJanssen closed 1 week ago

MarvinJanssen commented 1 week ago

Describe the bug When you use clarinet new to create a project in the current folder, it will break devnet. The reason is that it names the project '.' which causes the Docker network names to look like this: stacks-node...devnet. The resulting tool looks like this:

[project]
name = '.'

To Reproduce

mkdir broken
cd broken
clarinet new .
clarinet devnet start

Expected behavior Everything should still work properly.

Suggested fix When using a path, Clarinet should use the folder name as the project name. In the example above, it should take the name broken. Then we can use clarinet new .. Additionally, it is probably good to filter out illegal characters in the name for the Docker network names. (If it is not done already.)

hugocaillard commented 1 week ago

You're right we should handle that better. I'll try to get it fixed for the next release