Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional features (refresh keyword, better parameter passing, terminal window bug fix) #40

Closed
wants to merge 6 commits into from

Conversation

jcaille
Copy link
Contributor

@jcaille jcaille commented Jan 5, 2016

Hi !

I'm really interested in this project, and have added a few features that I needed for a few scripts

Refresh keyword

Adding the keyword refresh after the | adds an action to the menu item. Upon clicking this button, the plugin will be refreshed immediately.

Better parameter passing

The logic for parsing the parameter string felt a bit weak and prevented passing path containing spaces (or including small bash scripts inline)

I've refactored the way parameters are scanned using an NSScanner, which should be a bit more legible and robust. The legacy behaviour is kept, but this kind of lines are now possible

Say something | bash="say Hello world"
Say something else | bash:'say Goodbye moon;exit' terminal=true

Terminal window management

Launching a bash script by clicking a button failed when the frontmost terminal window was already running. I've changed the AppleScript to make sure to run the script in a new terminal window if terminal=true.
We might also include a keyword to close this window if the script returned a no error (0) status code

Let me know if you'd prefer multiple pull request

@jcaille jcaille changed the title Additional features Additional features (refresh keyword, better parameter passing, terminal window bug fix) Jan 5, 2016
@matryer
Copy link
Owner

matryer commented Jan 5, 2016

Multiple PRs would be great - I need to better understand some of what you've done. That ok?

@matryer
Copy link
Owner

matryer commented Jan 5, 2016

Would you be interested in contributing to the project? I am considering a Swift rewrite.

@jcaille
Copy link
Contributor Author

jcaille commented Jan 5, 2016

No problems at all !

I'll do that in the next few hours (and i'll make sure to update the
documentation as well.)

I'd love to contribute to the project. At the moment, i'm just adding features to match my needs.
Not very experienced with swift, but this might be a nice opportunity to learn

On 5 January 2016 at 11:27, Mat Ryer notifications@github.com wrote:

Multiple PRs would be great - I need to better understand some of what
you've done. That ok?


Reply to this email directly or view it on GitHub
#40 (comment).

Jean Caillé added 6 commits January 5, 2016 13:25
Manually refreshes Executable Plugins
> Now using NSScanner to parse key/value
> key='value with space' is now a valid syntax, allowing more complex bash commands to be executed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants