ponylang / pony-stable

:horse: A simple dependency manager for the Pony language.
BSD 2-Clause "Simplified" License
134 stars 18 forks source link

Some errors are silently eaten and not displayed #48

Closed tbillington closed 6 years ago

tbillington commented 7 years ago

Running commands using pony stable doesn't seem to do anything on OSX.

I have a bundle.json

{
  "type": "github",
  "repo": "oraoto/pony-websocket"
}

When running stable fetch nothing happens.

I then tried emptying bundle.json then running stable add github oraoto/pony-websocket. Nothing happened again, bundle.json was still empty.

I then tried stable add github jemc/pony-inspect as suggested in the pony-stable help command, still no effect.

> stable version
0.1.1 [release]
SeanTAllen commented 7 years ago

@tbillington i assume you have git installed? what version of OSX? I use stable on OSX without issue every day. I'm unable to reproduce.

screenshot 2017-11-04 12 42 26
tbillington commented 7 years ago

OSX 10.12.6

I tried your commands in a fresh directory and it worked :) !

It seems that having a malformed bundle.json in the directory prevented stable from doing anything. As you can see from my terminal history below running add gave no output.

~/pwildlife > stable add oraoto/pony-websocket
Couldn't find type 'oraoto/pony-websocket'.
Available types are github, local-git, and local.
~/pwildlife > stable add github oraoto/pony-websocket
~/pwildlife > cat bundle.json
{}
~/pwildlife > ls
bundle.json main.pony   pwildlife
~/pwildlife > stable env ponyc
Building builtin -> /usr/local/Cellar/ponyc/0.20.0/packages/builtin
Building . -> /Users/trent/pwildlife
Error:
websocket: couldn't locate this path
Error:
/Users/trent/pwildlife/main.pony:1:1: can't load package 'websocket'
use "websocket"
^
SeanTAllen commented 7 years ago

@tbillington do you have a "malformed" bundle.json we can use to test with so we can verify we fixed the issue?

tbillington commented 7 years ago
{
  "type": "github",
  "repo": "oraoto/pony-websocket"
}

and

{}

If the bundle.json is an empty file there is an error message, that's why I thought it was strange when there was no output for the above incorrectly formed bundle.json.

> stable add github oraoto/pony-websocket
JSON error at: /Users/trent/pwildlife/bundle.json:1 : Unexpected EOF in top level value
JSON error at: /Users/trent/pwildlife/bundle.json:1 : Unexpected EOF in top level value
JSON error at: /Users/trent/pwildlife/bundle.json:1 : Unexpected EOF in top level value