ZenVoich / mops

Package manager for the Motoko programming language
https://mops.one
MIT License
40 stars 5 forks source link

Mops init is failing #160

Closed skilesare closed 1 year ago

skilesare commented 1 year ago

mac os

afat@virusbook rdf.mo % mops --version
CLI 0.28.1
API 1.2
afat@virusbook rdf.mo % 

mops init rdf.mo
Initializing...
✔ Select type: › Package (I plan to publish this package on mops)
✔ Enter package name: … x.mo
✔ Enter package description: … x for motoko
✔ Enter package repository url: … 
✔ Enter keywords separated by spaces: … 
✔ Choose a license: › MIT
✔ Enter license copyright owner: … 
✔ Add example test file? (test/lib.test.mo) … no
✔ Setup GitHub workflow? (run `mops test` on push) … no

undefined:1

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at applyInit (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/dist/commands/init.js:149:28)
    at init (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/dist/commands/init.js:135:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Command.<anonymous> (file:///Users/afat/.nvm/versions/node/v16.19.0/lib/node_modules/ic-mops/dist/cli.js:36:5)
ZenVoich commented 1 year ago

Thanks for the bug report!

It looks like there is a dfx.json but it's empty or contains invalid json.

Fixed in mops 0.28.3 , now it will show warning and proceed, instead of failing.

image