-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compile all contracts if contract name not specified #121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
this.error(`Cannot find a contract named ${args.contractName} in swanky.config.json`); | ||
const contractNames = []; | ||
if (flags.all) { | ||
const contractList = readdirSync(path.resolve("contracts"), { withFileTypes: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't contracts listed in swanky.config.json
? Currently this logic leads to an error, for example in case of empty directiory.
Error: Cannot find contract info for test contract in swanky.config.json
I think we should treat swanky.config.json
as a source of list of all contracts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be as simple as
for (const contractName in config.contracts) {
contractNames.push(contractName);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. We need to decide what will be the final source of truth. This idea of reading the contract directory and comparing to config is an artefact from the past I think.
We'll address that in the upcoming feature that will allow to init a project with an existing contract and sync the config file according to the folder contents #111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true... thank you so much! will fix it soon
In this PR #121, wrongly deleted `required` option for contract test command while resolving merge conflicts.
swanky-cli projects will have github actions test CI script by default. This feature #121 needs to be merged and released to work.
Resolve #110