From 5496a605bad26c5ff82395a952ca4ec449390d5b Mon Sep 17 00:00:00 2001 From: Andri Rakotomalala Date: Wed, 7 Mar 2018 20:21:21 +0100 Subject: [PATCH 1/5] fix crash on windows process.getuid() does not exist on windows --- lib/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 5f35785..6b87668 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -12,7 +12,8 @@ module.exports.validate_writeable_directory = function(dir) { } // Check whether this owner or group or anyone is allowed to write the directory. - var can_write = ((process.getuid() === stat.uid) && (stat.mode & 00200)) || // User is owner and owner can write. + var can_write = (!process.getuid) || // process.getuid() does not exist on windows + ((process.getuid() === stat.uid) && (stat.mode & 00200)) || // User is owner and owner can write. ((process.getgid() === stat.gid) && (stat.mode & 00020)) || // User is in group and group can write. ((stat.mode & 00002)); // Anyone can write. if (!can_write) { From ebff68622fd1a606e82c6215b565a18d76ff2833 Mon Sep 17 00:00:00 2001 From: Andri Rakotomalala Date: Wed, 7 Mar 2018 20:49:47 +0100 Subject: [PATCH 2/5] prublish as a new npm package (waiting for Pull Request approval) --- README.md | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ee68dcf..da89042 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +> This utility is **exactly** the same as [breser/git2consul](https://github.com/breser/git2consul) but it includes a small patch that fixes a crash on Windows. + # git2consul [![Build Status](https://travis-ci.org/breser/git2consul.svg?branch=master)](https://travis-ci.org/breser/git2consul) diff --git a/package.json b/package.json index 5feb215..c698b83 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "git2consul", + "name": "git2consul-windows", "description": "System for moving data from git to consul", "license": "Apache-2.0", "version": "0.12.13", From 9fb6bfa95a7350046fbaf7b566804d34104c534c Mon Sep 17 00:00:00 2001 From: Andri Rakotomalala Date: Wed, 7 Mar 2018 20:52:35 +0100 Subject: [PATCH 3/5] change repo.url --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c698b83..941cdba 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ ], "repository": { "type": "git", - "url": "git://github.com/Cimpress-MCP/git2consul.git" + "url": "git://github.com/andriniaina/git2consul-windows.git" }, "dependencies": { "body-parser": "~1.4.3", From 03545e0115fe29e0eb27af067278484c15948f65 Mon Sep 17 00:00:00 2001 From: Andri Rakotomalala Date: Wed, 7 Mar 2018 20:54:36 +0100 Subject: [PATCH 4/5] add myself as contributor ;) --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 941cdba..f2801b0 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,10 @@ { "name": "Ryan Breen", "email": "rbreen@cimpress.com" + }, + { + "name": "Andri Rakotomalala", + "email": "andriniaina@gmail.com" } ], "repository": { From 90e1575324aff659ae1167bac5977a776e8cbc77 Mon Sep 17 00:00:00 2001 From: Andri Rakotomalala Date: Wed, 7 Mar 2018 20:55:16 +0100 Subject: [PATCH 5/5] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f2801b0..536b177 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "git2consul-windows", "description": "System for moving data from git to consul", "license": "Apache-2.0", - "version": "0.12.13", + "version": "0.12.14", "contributors": [ { "name": "Ryan Breen",