Skip to content

Commit

Permalink
fixes type to be the same as the event names (#32)
Browse files Browse the repository at this point in the history
* fixes type to be the same as the event names

* updates changelog
  • Loading branch information
gabrielcsapo authored Dec 5, 2017
1 parent abd8fa4 commit f3f7396
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.4.1 (12/04/2017)

- fixes type to be the same as the event names

# 0.4.0 (12/03/2017)

- [BREAKING] changes the interface for authentication to make it more flexible
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> 🎡 A configurable git server written in Node.js
>> there be 🐲 here! The API's and functionality are still be cemented, anything before a 1.0.0 release will be subject to change.
>> there be 🐲 here! The API's and functionality are still be cemented, anything before a 1.0.0 release will be subject to change.
[![Npm Version](https://img.shields.io/npm/v/node-git-server.svg)](https://www.npmjs.com/package/node-git-server)
[![Build Status](https://travis-ci.org/gabrielcsapo/node-git-server.svg?branch=master)](https://travis-ci.org/gabrielcsapo/node-git-server)
Expand All @@ -25,7 +25,7 @@ const Server = require('node-git-server');
const repos = new Server(path.resolve(__dirname, 'tmp'), {
autoCreate: true,
authenticate: (type, repo, user, next) => {
if(type == 'upload') {
if(type == 'push') {
user((username, password) => {
console.log(username, password);
next();
Expand Down
2 changes: 1 addition & 1 deletion example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const repos = new Server(path.normalize(path.resolve(__dirname, 'tmp')), {
autoCreate: true,
authenticate: (type, repo, user, next) => {
console.log(type, repo); // eslint-disable-line
if(type == 'upload') {
if(type == 'push') {
user((username, password) => {
console.log(username, password); // eslint-disable-line
next();
Expand Down
7 changes: 4 additions & 3 deletions lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,17 @@ class Git extends EventEmitter {
/**
* returns the typeof service being process
* @method getType
* @param {Service} service - the service type
* @param {String} service - the service type
* @return {String} - will respond with either upload or download
*/
getType(service) {
switch(service) {
case 'upload-pack':
return 'fetch';
case 'receive-pack':
return 'upload';
return 'push';
default:
return 'download';
return 'unknown';
}
}
/**
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": "node-git-server",
"version": "0.4.0",
"version": "0.4.1",
"description": "🎡 A configurable git server written in Node.js",
"author": "Gabriel J. Csapo <[email protected]>",
"contributors": [
Expand Down

0 comments on commit f3f7396

Please sign in to comment.