Skip to content

Commit

Permalink
Fixed installCmd as array
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Nov 2, 2015
1 parent 4d42fab commit 2da7f28
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/views/addons_page.html
Expand Up @@ -62,7 +62,9 @@ <h2>About</h2>
<div class="col-xs-12 author-div">
<h2>Installation instructions</h2>
<p>In the Forge CLI:</p>
<code>{{addon.installCmd}}</code>
<p ng-repeat="cmd in addon.installCmd">
<code>{{cmd}}</code>
</p>
</div>
</div>

Expand Down
10 changes: 8 additions & 2 deletions server.js
Expand Up @@ -11,8 +11,8 @@ var cc = require('config-multipaas'),
exec = require('child_process').exec,
moment = require('moment'),
cheerio = require('cheerio'),
asciidoctor = require('asciidoctor.js')();

asciidoctor = require('asciidoctor.js')(),
util = require('util');
// Git utilities
var Git =
{
Expand Down Expand Up @@ -258,6 +258,9 @@ function allAddons() {
.map(function (item) {
item.type = 'community';
item.installCmd = (item.installCmd || 'addon-install-from-git --url '+item.repo+' --coordinate '+item.id+ (item.ref != 'master' ? ' --ref '+item.ref : ''));
if (!util.isArray(item.installCmd)) {
item.installCmd = [item.installCmd];
}
if (item.tags) {
item.tags = item.tags.split(',').map(function(elem){return elem.trim().toLowerCase();});
}
Expand All @@ -267,6 +270,9 @@ function allAddons() {
.map(function (item) {
item.type = 'core';
item.installCmd = (item.installCmd || 'addon-install --coordinate '+item.id);
if (!util.isArray(item.installCmd)) {
item.installCmd = [item.installCmd];
}
if (item.tags) {
item.tags = item.tags.split(',').map(function(elem){return elem.trim().toLowerCase();});
}
Expand Down

0 comments on commit 2da7f28

Please sign in to comment.