matryer / xbar-plugins

Plugin repository for xbar (the BitBar reboot)
https://xbarapp.com
2.45k stars 1.04k forks source link

Add `demo` to metadata in test script and take screenshots #389

Closed iosdeveloper closed 7 years ago

iosdeveloper commented 8 years ago

demo - Whitespace separated arguments to execute plugin with in demo mode (i.e. when saving a screenshot)

Full example: https://github.com/iosdeveloper/ScreenshotTest/blob/master/Plugins/cycle_text_and_detail.sh

In my opinion, on a pull request we should:

take a screenshot for members with push access to check if it looks good on dark mode too and (passively) suggest using the Imgur URL if the image tag is missing or invalid.

Otherwise (no PR) it should only take a screenshot if the image tag is missing or invalid.

I wrote a proof of concept in bash here: https://github.com/iosdeveloper/ScreenshotTest/blob/master/screenshot.sh Travis CI build looks like this: https://travis-ci.org/iosdeveloper/ScreenshotTest/builds/123342526 Results with the example above: https://i.imgur.com/3xZVato.png https://i.imgur.com/7ktGXHe.png

tresni commented 8 years ago

The problem with this approach is what about plugins that have dependancies? The line will become very complicated in that case:

# <bitbar.demo>brew install xyz; pip install python-doessomething;etc</bitbar.demo>

I'm not sure that's the best way to handle it...

iosdeveloper commented 8 years ago

demo contains any arguments that are passed to the plugin by BitBar when executing. I didn't consider dependencies but couldn't the plugin handle the installation when it detects that it is in demo mode?