Projects with no `.openzeppelin` directory and no `package.json` error on `npx oz compile`: No contracts found to compile.
Projects with no .openzeppelin directory and no package.json , e.g. where npm init and npx oz init have't been run will error when attempting to compile using npx oz compile.
$ npx oz compile
No contracts found to compile.
To reproduce create a new project with a contracts directory containing a contract and then attempt to compile.
Once an openzeppelin directory is created compilation is allowed
$ mkdir .openzeppelin
$ npx oz compile
✓ Compiled contracts with solc 0.5.16 (commit.9c3226ce)
I have not been able to reproduce this using 2.6: npx oz compile works fine on my machine on new project with Solidity sources inside contracts and no .openzeppelin directory.
@nventuro the error appears to only be when there also isn't a package.json too. I have updated the title.
Steps to reproduce:
$ mkdir issue1378 && cd issue1378
$ npm install --save-dev @openzeppelin/cli
$ mkdir contracts
Save Simple.sol contract into contracts directory. nano contracts/Simple.sol
Simple.sol
pragma solidity ^0.5.0;
contract Simple {
}
$ npx oz compile
No contracts found to compile.