xJonathanLEI / starkli

Starkli (/ˈstɑːrklaɪ/), a ⚡ blazing ⚡ fast ⚡ CLI tool for Starknet powered by 🦀 starknet-rs 🦀
https://book.starkli.rs
Apache License 2.0
164 stars 47 forks source link

Issue with --account flag: Account Config File Not Found Error #17

Closed omarespejel closed 1 year ago

omarespejel commented 1 year ago

Hey @xJonathanLEI!

When using the --account flag in a declaration, I am not getting the following error:

starkli declare target/dev/starknetbook_chapter_2_Vote.sierra.json --compiler-version=2.0.1 --rpc=http://0.0.0.0:5050 --account=~/.starkli-wallets/deployer/account0.json

Error: account config file not found

However, when the account is set, with the same path, as an ENV variable, there is no problem:

export STARKNET_ACCOUNT=~/.starkli-wallets/deployer/account0.json
xJonathanLEI commented 1 year ago

That's weird. Lemme check and revert.

omarespejel commented 1 year ago

Thank you @xJonathanLEI 🙏

xJonathanLEI commented 1 year ago

Can confirm this is indeed the case when using --account=xxx instead of --account xxx. Pretty sure this is a clap issue. Will loop deeper.

xJonathanLEI commented 1 year ago

This is because when you use =, the whole argument is taken as one as your shell doesn't expand the tilde for you.

This issue actually affects anything involving a path. Will submit a fix.

omarespejel commented 1 year ago

Interesting. And this only happens with the --account flag. Thank you for the feedback and for reviewing @xJonathanLEI!

xJonathanLEI commented 1 year ago

This is fixed in https://github.com/xJonathanLEI/starkli/commit/ebcf7d53c8d18cd72c17d24862b1e5a8e0e1bb40 and shipped with release v0.1.7.