matryer / xbar-plugins

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

Node script with dependencies #1118

Open colbin8r opened 5 years ago

colbin8r commented 5 years ago

I've written a BitBar plugin in JavaScript. My script has a few dependencies (including the suggested bitbar package) and so I'm not sure how to contribute it to the plugins repo.

In my readme, I suggest cloning the repo into the plugins folder, installing the dependencies (npm install), and then symlinking the script into the plugins folder. It works great, but I'd like to contribute it to the folder to help make it easier for others to find.

Seeing as I can only contribute a single script file without dependencies, what's the best way to submit the plugin to this repo?

colbin8r commented 5 years ago

I ended up including a bash script to perform the install. https://github.com/colbin8r/bitbar-docker-ps/blob/master/install.sh

However, it doesn't seem BitBar can carry over the $PATH, so for now it has to be invoked manually.

LitoMore commented 5 years ago

Same issue.

I think the best way to install a Node.js plugin is linking the file to the plugin folder automatically at the postinstall stage. In this way, we could publish our package as a global package to the npm registry.

Unfortunately, we cannot get the BitBar plugin path from the environment variable 💔.

grasmash commented 2 years ago

I'd like to do the same but for a PHP script with Composer dependencies. I'd like xBar to enable me to ship more than 1 file.

It seems like changing the directory structure to enable each plugin to have its own directory would be better.