Skip to content

Commit

Permalink
Merge branch '1.1.6'
Browse files Browse the repository at this point in the history
* 1.1.6:
  version 1.1.6
  fix failing tests
  Add website link to repositories on webUI fixes #182
  Update utils.js
  the callback function for exec accepts 3 arguments, added 3rd argument (stderr), which is where a command line program would typically output the error.  Also, for clarity, output the error on a second line.
  Added some documentation to clear up confusion regarding public registry.
  • Loading branch information
Hacklone committed Nov 8, 2015
2 parents 387d719 + 029a51d commit a45338c
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 11 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
- fixed JSON parse errors ([#170](https://github.com/Hacklone/private-bower/issues/170))
- never used utils.process.env.PORT ([#159](https://github.com/Hacklone/private-bower/issues/159))

## 1.1.5 - 2015.10.10
## 1.1.5 - 2015.10.10.

- change registry url ([#179](https://github.com/Hacklone/private-bower/issues/179))
- change registry url ([#179](https://github.com/Hacklone/private-bower/issues/179))

## 1.1.6 - 2015.11.08.

- Added some documentation to clear up confusion regarding public registry. ([#184](https://github.com/Hacklone/private-bower/issues/184))
- Show the git url of a package (as a link) ([#182](https://github.com/Hacklone/private-bower/issues/182))
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ Must be a valid JSON
#Usage

##Web interface
Convenient way for viewing your packages in a browser
Convenient way for viewing your packages in a browser. The web interface will only list your private packages, it will
not list the public packages if you have a public registry enabled. However, when searching for packages in bower, the
public ones will show up just fine.

> http://localhost:5678/
##Project
Expand Down
7 changes: 4 additions & 3 deletions lib/infrastructure/spec/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,17 @@ describe('Utils', function() {

it('should return log if error occurs', function() {
var error = 'error';
var stdOut = 'errorDetail';
var stdOut = 'testStdOut';
var stdErr = 'testStdErr';

utils.exec('testCommand', 'testCWD')
.catch(function() {});

var callback = execMock.args[0][2];

callback(error, stdOut);
callback(error, stdOut, stdErr);

expect(loggerMock.log).to.have.been.calledWith('Error during "testCommand" in "testCWD". Output was: ' + stdOut);
expect(loggerMock.log).to.have.been.calledWith('Error during "{0}" in "{1}".\n\tOutput:\n\t\tstdout: {2}\n\t\tstderr: {3}'.format('testCommand', 'testCWD', stdOut, stdErr));
});
});

Expand Down
4 changes: 2 additions & 2 deletions lib/infrastructure/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ module.exports = function Utils() {

function _exec(command, cwd) {
return new Promise(function(resolve, reject) {
exec(command, {cwd: cwd}, function(error, stdout) {
exec(command, {cwd: cwd}, function(error, stdout, stderr) {
if(error) {
logger.log('Error during "{0}" in "{1}". Output was: {2}'.format(command, cwd, stdout));
logger.log('Error during "{0}" in "{1}".\n\tOutput:\n\t\tstdout: {2}\n\t\tstderr: {3}'.format(command, cwd, stdout, stderr));

reject(error);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "private-bower",
"version": "1.1.5",
"version": "1.1.6",
"author": "Hacklone <[email protected]>",
"description": "A simple private bower registry",
"main": "./bin/private-bower",
Expand Down
6 changes: 5 additions & 1 deletion site/controllers/mainController.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ angular.module('PrivateBower')
function _getPackages() {
$http.get('packages')
.success(function(packages) {
self.packages = packages;
self.packages = packages.map(function(pack) {
pack.siteUrl = pack.url.replace('git://', 'https://');

return pack;
});
})
.error(function(error) {
self.error = true;
Expand Down
9 changes: 8 additions & 1 deletion site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<link rel="stylesheet" href="vendor/bootstrap/dist/bootstrap.min.css">
<link rel="stylesheet" href="vendor/animate/animate.min.css">
<link href="vendor/source-sans-pro/source-sans-pro.css" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" href="private-bower.css">

<script src="vendor/angular/angular.min.js"></script>
Expand Down Expand Up @@ -76,6 +77,12 @@ <h1>private-bower</h1>
<div class="col-md-6 col-xs-6">
<h3 style="line-height: 1.5em; cursor: pointer;" class="text-primary" ng-click="mainController.togglePackageDetailsOpened(package)">
{{ package.name }}
&nbsp;
<a ng-href="{{ package.siteUrl }}" target="_blank"
title="Open repository's website"
style="font-size: 15px">
<i class="fa fa-external-link"></i>
</a>
</h3>
</div>
<div class="col-md-2 col-xs-2 text-right" style="line-height: 2.5em">
Expand All @@ -94,7 +101,7 @@ <h3 style="line-height: 1.5em; cursor: pointer;" class="text-primary" ng-click="
Loading package details...
</span>
<span ng-if="package.detailsError" class="text-danger">
Failed to load package details! (Your private-bower server needs read access to this Git repository!)
Failed to load package details! (Your private-bower server needs read access to this Git repository and the git repository must contain a bower.json file!)
</span>
</div>
<div ng-if="package.details" class="details">
Expand Down

0 comments on commit a45338c

Please sign in to comment.