From 8926c950216e9bda14a16fda49f020f9288f0757 Mon Sep 17 00:00:00 2001 From: Michael Hellein Date: Tue, 5 May 2015 11:34:14 -0400 Subject: [PATCH 1/3] Added support for bash aliases. --- lib/run.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/run.js b/lib/run.js index bdd4609..6b1b788 100644 --- a/lib/run.js +++ b/lib/run.js @@ -7,7 +7,7 @@ module.exports = function(line, cwd, onDone) { var parts = (Array.isArray(line) ? line : line.split(' ')), task; - task = spawn(parts[0], parts.slice(1), { + task = spawn('/bin/bash', ['-l', '-O', 'expand_aliases', '-c', parts.join(' ')], { cwd: cwd, stdio: ['ignore', process.stdout, process.stderr] }); From 92a269c02e4d8d12e3040d05398956e962c0979e Mon Sep 17 00:00:00 2001 From: Michael Hellein Date: Tue, 5 May 2015 11:41:22 -0400 Subject: [PATCH 2/3] Added note on fork to README. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index f3b261c..62b88c4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +## This Fork + +The purpose of this fork is to expand bash aliases, allowing you to run commands like `gr @something gl` when you've got `alias gl='git pull'` in your profile. **Currently only works for bash.** + +To install this fork: `npm install -g git+ssh://git@github.com:michaek/gr.git` + ## Features - Tag all the things! `gr @work foo` will run the command `foo` in all the paths tagged `@work`. From 17b63df9ac19f191bd9dd950cbcc6db84aff23bf Mon Sep 17 00:00:00 2001 From: Michael Hellein Date: Thu, 7 May 2015 15:08:16 -0400 Subject: [PATCH 3/3] Made (optimistically) shell agnostic. --- README.md | 6 ++++++ lib/run.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f3b261c..0b09887 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +## This Fork + +The purpose of this fork is to expand aliases from your current shell, allowing you to run commands like `gr @something gl` when you've got `alias gl='git pull'` in your profile. + +To install this fork: `npm install -g @michaek/git-run` + ## Features - Tag all the things! `gr @work foo` will run the command `foo` in all the paths tagged `@work`. diff --git a/lib/run.js b/lib/run.js index 6b1b788..61e4e25 100644 --- a/lib/run.js +++ b/lib/run.js @@ -7,7 +7,7 @@ module.exports = function(line, cwd, onDone) { var parts = (Array.isArray(line) ? line : line.split(' ')), task; - task = spawn('/bin/bash', ['-l', '-O', 'expand_aliases', '-c', parts.join(' ')], { + task = spawn(process.env.SHELL || '/bin/bash', ['-l', '-O', 'expand_aliases', '-c', parts.join(' ')], { cwd: cwd, stdio: ['ignore', process.stdout, process.stderr] });