kasperpeulen / gist-generator

Create gists from the command line.
MIT License
3 stars 1 forks source link

Add a message when no valid directories are found #1

Closed kwalrath closed 9 years ago

kwalrath commented 9 years ago

I've just used gist generate for the first time, and it worked great! I was especially happy to see that I could easily update the gist in place.

I accidentally used gist generate from the wrong directory (inside of web), and got no output at all. Instead, I'd like to see a message like this:

Found no apps to convert: No subdirectories contain a web directory.

I think it might be nice to be able to generate a gist from the app's root directory, rather than a directory above, in case you have a github repo with only one sample, or you're really not ready to regenerate some other samples in the repo. If you support this case, you'd need to adjust the error messages accordingly.

Here, in case you're curious, is a transcript of what I did:

$ gist generate
...
Skipping web_app: Too many files.
$ ls web_app/web
packages@ web_app.dart web_app.html
$ rm  web_app/web/packages
$ gist generate
...
Skipping web_app: Files can only have the name index.html/main.dart/styles.css.
$ cd web_app/web
$ git mv web_app.dart main.dart
$ git mv web_app.html index.html
$ vim index.html
$ gist generate
...
(silently fails)
$
$ cd ../..
$ gist generate
...
"web_app" gist created at https://gist.github.com/cfeea02a02048cead535
Homepage inserted in pubspec.yaml
$ 
kwalrath commented 9 years ago

/cc @Sfshaza

kasperpeulen commented 9 years ago

I added a message if there is no web directory. @kwalrath

kasperpeulen commented 9 years ago

those messages are no shown with the option --verbose

kwalrath commented 9 years ago

Thanks!