Hello,
Since 1.9, my bash commands don't work anymore, example (node.js script):
console.log("Pull | bash='cd /my/path/ && git pull' ")
Error :
$ 'cd /my/path && git pull'
-bash: cd /my/path && git pull : No such file or directory
where /my/path is valid
I didn't change anything and it works with version 1.8, looks like a problem with quotes (or && ?)
Relates to #266, so pinging @tresni and @vogonistic.
bash=, but allows spaces to be in the path.One potential solution would be to make the #266 solution conditional on a check if params[@"bash"] is a file, otherwise just send it to the terminal and assume that it will work.
@iosdeveloper @matryer What is your take?
Less magic is better, it's a shame when we break plugins - I suppose we should offer to fix any that we break during BitBar development?
On 22 Mar 2016, at 15:40, Kent Karlsson [email protected] wrote:
266 changed so that you have to call a script directly with bash=, but allows spaces to be in the path.
One potential solution would be to make the #266 solution conditional on a check if params[@"bash"] is a file, otherwise just send it to the terminal and assume that it will work.
@iosdeveloper @matryer What is your take?
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
I didn't realize #266 was a breaking change. We shouldn't do that. A possible solution is to use the same code as in 2ada38c.
Ugh.. Without realizing it we completely reverted babac11da02d1671b67e524a7bec650b6b55a6f4 by implementing this. I didn't notice as I've refactored most of my plugins to not have complex arguments in the bash= param. 2ada38c worked as it only modified the runPluginExternally path which is correct. So basically, #266 hit the wrong code path.
Few things should probably happen:
bash=/runPluginExternally parsing gives the output we wantrunPluginExternallyI don't see how #266 reverts that change. It only affects the creation of applescript for executing in Terminal.app.
Because with #266 complex commands (like cd some/dir && git pull) will never work. Essentially #266 treats all bash= arguments as if they should be executables vs being potential shell commands. Even applying 2ada38c would be bad to bash= arguments as it would still convert cd some/dir && git pull into cd\ some/dir\ &&\ git\ pull.
You also can no longer pass arguments to an executable using a single bash= entry as you are making it all one big string, so even /usr/bin/local/brew install test wouldn't work as it would be interepreted as the string /usr/bin/local/brew\ install\ test (ie an executable named "brew install test" versus calling brew with the arguments install & test.)
I see what you mean. I was reading revert it in a git sense.
We might want to figure out if bash= means execute bash and have it interpret this or execute this shell script. Both sound like reasonable interpretations, but since we don't actually enforce that it's executed in bash as interpreter, there might be better names for both actions.
Since I was the only one that had issues with spaces in the path, maybe it'll be easiest to just revert #266 for now. I can escape it in my script until we figure out a better solution.
Do we agree that it is best to revert #266 for now?
Yes
On 22 Mar 2016, at 19:01, iosdeveloper [email protected] wrote:
Do we agree that it is best to revert #266 for now?
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
Who wants to do this?
Done (d763cce).
Let me know if you think a v1.9.1 release is in order.
On 25 Mar 2016, at 18:08, iosdeveloper [email protected] wrote:
Done (d763cce https://github.com/matryer/bitbar/commit/d763cce29770edd13053fc640f40c051cce6bb1b).
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub https://github.com/matryer/bitbar/issues/297#issuecomment-201397796
I'd vote yes
-- Brian
On Mar 25, 2016, at 12:32 PM, Mat Ryer [email protected] wrote:
Let me know if you think a v1.9.1 release is in order.
On 25 Mar 2016, at 18:08, iosdeveloper [email protected] wrote:
Done (d763cce https://github.com/matryer/bitbar/commit/d763cce29770edd13053fc640f40c051cce6bb1b).
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub https://github.com/matryer/bitbar/issues/297#issuecomment-201397796—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
Most helpful comment
Do we agree that it is best to revert #266 for now?