Skip to content

Commit

Permalink
Abstract branchOverride var to re-use elsewhere.
Browse files Browse the repository at this point in the history
  • Loading branch information
doctyper committed Aug 9, 2012
1 parent 28a7a39 commit 1d28037
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/tasks/helpers/install-plugin.js
Expand Up @@ -8,6 +8,7 @@ module.exports = function (grunt) {
var pkg = require("../utils/pkg");

var isRBP = (plug.indexOf("red-boilerplate") !== -1);
var branchOverride = (isRBP) ? plug.split("@")[1] : null;

var completeInstall = function (plug, plugPkg, cb) {
if (fs.existsSync("./install.js")) {
Expand Down Expand Up @@ -156,7 +157,7 @@ module.exports = function (grunt) {
grunt.log.writeln(("[!]".magenta + (action + p.name + " from " + source).grey).bold);

if (plugRepo) {
var plugBranch = plugRepo.branch || "master";
var plugBranch = branchOverride || plugRepo.branch || "master";
grunt.file.mkdir(plug);

grunt.utils.spawn({
Expand Down Expand Up @@ -209,7 +210,6 @@ module.exports = function (grunt) {

var initialize = function () {
var p = (isRBP && pkg.config.rbp) ? pkg.config.rbp : pkg;
var branchOverride = (isRBP) ? plug.split("@")[1] : null;

grunt.utils.spawn({
cmd: "git",
Expand Down

0 comments on commit 1d28037

Please sign in to comment.