Currently when a new project is made with anchor init, running anchor test will display a warning because the package.json is missing the license field:
warning package.json: No license field
This PR uses the system's configured default license (ie, what npm init -y would use) to set the license for the new project.
People can set their system's default license with npm config set init-license "<license name>". Eg
npm config set init-license "MIT" (if you prefer MIT to be the default)
npm config set init-license "UNLICENSED" (if you do not wish to make your code open source)
Note this is my first PR to a Rust project, so if you have any suggestions for the code please let me know!
Currently when a new project is made with
anchor init
, runninganchor test
will display a warning because the package.json is missing thelicense
field:This PR uses the system's configured default license (ie, what
npm init -y
would use) to set the license for the new project.People can set their system's default license with
npm config set init-license "<license name>"
. Egnpm config set init-license "MIT"
(if you prefer MIT to be the default)npm config set init-license "UNLICENSED"
(if you do not wish to make your code open source)Note this is my first PR to a Rust project, so if you have any suggestions for the code please let me know!