Permalink
Browse files

upgrade shell-quote, make room for globs

  • Loading branch information...
1 parent a7a0160 commit cdd38fd485937afea3beaceb54f6224180365f2d @substack committed Oct 18, 2013
Showing with 9 additions and 2 deletions.
  1. +7 −0 index.js
  2. +2 −2 package.json
View
@@ -31,6 +31,7 @@ function Bash (opts) {
this._writer = opts.write || function () {};
this._spawner = opts.spawn || function () {};
this._exists = opts.exists || function (file, cb) { cb(false) };
+ this._globber = opts.glob || function (p, cb) { cb(p) };
this._cursorX = 0;
this.history = [];
@@ -362,6 +363,12 @@ Bash.prototype.eval = function (line) {
var commands = [];
for (var i = 0; i < parts.length; i++) {
+ if (typeof parts[i] === 'object' && parts[i].op === 'glob') {
+ // todo: globs
+ parts[i] = parts[i].pattern;
+ }
+ }
+ for (var i = 0; i < parts.length; i++) {
if (typeof parts[i] === 'object' && parts[i].op) {
commands.push(parts[i]);
}
View
@@ -1,13 +1,13 @@
{
"name": "bashful",
- "version": "1.4.3",
+ "version": "1.5.0",
"description": "parse and execute bash without doing any IO",
"main": "index.js",
"dependencies": {
"through": "~2.3.4",
"resumer": "~0.0.0",
"duplexer": "~0.0.4",
- "shell-quote": "~1.3.3",
+ "shell-quote": "~1.4.0",
"decode-prompt": "~0.0.1",
"minimist": "~0.0.1",
"inherits": "~1.0.0"

0 comments on commit cdd38fd

Please sign in to comment.