Skip to content

Commit

Permalink
Updating submodule path
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple committed Jul 24, 2017
1 parent 65170fe commit a8c401c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "utils/gitifyhg"]
path = utils/gitifyhg
[submodule "libs/gitifyhg"]
path = libs/gitifyhg
url = https://github.com/jdalrymple/gitifyhg.git
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: node_js
node_js:
- "node"
- "6"
- "6.0.0"

- "7.6"
- "7"
- "8"
before_install:
- sudo apt-get update
- sudo apt-get install python2.7
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

A node js client for [Mercurial](http://mercurial.selenic.com).

Supported node version => 6.0.0
Supported node version => 7.6.0

## Installation

Expand Down
5 changes: 3 additions & 2 deletions src/Command.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ const Promise = require('bluebird');
function run(command, directory = process.cwd(), options = []) {
return new Promise((resolve, reject) => {
const commandString = `${command} ${options.join(' ')}`;
console.log(commandString);

Exec(commandString, { cwd: directory }, (error, stdout, stderr) => {
const output = { error, stdout, stderr };

if (error) {
reject(output);
reject(error);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Hg.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Hg {

return Utils.asCallback(repo, done);
} catch (e) {
if (e.error.message.includes('not found')) {
if (e.message.includes('not found')) {
throw new TypeError('Incorrect type of from parameter. Clone source not found');
} else {
throw e;
Expand Down
4 changes: 2 additions & 2 deletions src/HgRepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ async function ensureGitify(pythonPath) {

class HgRepo {
constructor({ url, username = '', password = '', path } = {}, pythonPath = 'python') {
this.path = path || Utils.generateRepoName(url);
this.path = path || Utils.generateRepoPath(url);
this.username = username;
this.password = password;
this.url = url;
this.name = Path.basename(path);
this.name = Path.basename(this.path);
this.pythonPath = pythonPath;

Fs.ensureDirSync(this.path);
Expand Down
3 changes: 2 additions & 1 deletion src/Utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const Path = require('path');
const { URL } = require('url');

function asCallback(args, callback) {
if (callback) {
Expand All @@ -12,7 +13,7 @@ function buildRepoURL(urlObject) {
if (urlObject.password && urlObject.username) {
const parsedURL = new URL(urlObject.url);

return `${parsedURL.host}://${urlObject.username}:${urlObject.password}@${parsedURL.host}${parsedURL.pathname}`;
return `${parsedURL.protocol}//${urlObject.username}:${urlObject.password}@${parsedURL.host}${parsedURL.pathname}`;
}

return urlObject.url;
Expand Down

0 comments on commit a8c401c

Please sign in to comment.