Concordium / concordium-smart-contract-tools

Tools for building, deploying, and interacting with smart contracts
Apache License 2.0
2 stars 8 forks source link

`cargo concordium init` does not work if non-empty `concordium-contracts-common` folder exists #22

Open Bargsteen opened 1 year ago

Bargsteen commented 1 year ago

Bug Description

cargo concordium init does not work if non-empty concordium-contracts-common folder exists.

Steps to Reproduce

  1. Create a non-empty folder named concordium-contracts-common: mkdir concordium-contracts-common; touch concordium-contracts-common/a.txt
  2. Run cargo concordium init

Expected Result The wizard starts correctly:

❯ cargo concordium init
? 🤷   Which template should be expanded? ›
❯ cis2-nft
  default

Actual Result The wizard cannot run:

❯ cargo concordium init
Error: Please check if the Git user / repository exists.

Caused by:
    'concordium-contracts-common' exists and is not an empty directory; class=Invalid (3); code=Exists (-4)
Error: Could not create a new Concordium smart contract project.

Caused by:
    Could not use the template to initialize the project.

Versions

abizjak commented 1 year ago

This is fundamentally a bug in cargo generate and further it is actually a bug in its dependency (https://github.com/libgit2/libgit2/issues/5830)

I have reported a bug to cargo-generate with a suggested workaround https://github.com/cargo-generate/cargo-generate/issues/839