jigish/slate — pull request #258 by sugyan (2013-03-01 06:21:42+00:00)
Title: tokenize shell command with quote

I wrote .slate.js

```js
var launch_and_focus = function (target) {
return function (win) {
var apps = [];
S.eachApp(function (app) { apps.push(app.name()); });
if (! _.find(apps, function (name) { return name === target; })) {
win.doOperation(
S.operation('shell', {
command: "/usr/bin/open -a '" + target + "'",
waithFoeExit: true
})
);
}
win.doOperation(S.operation('focus', { app: target }));
};
};
S.bind('i:ctrl,cmd', launch_and_focus('iTerm'));
S.bind('g:ctrl,cmd', launch_and_focus('Google Chrome'));
```

if app exists, focus at app. if app doesn't exist, launch app by "open" command.
but this doesn't work on 'Google Chrome'. shell command was parsed as
`/usr/bin/open`, `-a`, `'Google` and `Chrome'` ...
shell command should be tokenized with quote.