From 1b8290ade1e3573a0f73357a060d1bdd4f23e011 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 3 Dec 2014 09:31:36 -0400 Subject: [PATCH] Cross platform home directory --- lib/resin/config.coffee | 6 +++--- package.json | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/resin/config.coffee b/lib/resin/config.coffee index ed598eb1..24b59a7f 100644 --- a/lib/resin/config.coffee +++ b/lib/resin/config.coffee @@ -1,5 +1,6 @@ _ = require('lodash') path = require('path') +userHome = require('user-home') config = @@ -7,9 +8,8 @@ config = remoteUrl: 'https://staging.resin.io' apiPrefix: '/ewa/' - # TODO: Check if not running on UNIX environment - # and add a custom path accordingly - dataPrefix: path.join(process.env.HOME, '.resin') + dataPrefix: path.join(userHome, '.resin') + sshKeyWidth: 43 directories: diff --git a/package.json b/package.json index 4a20195c..e29b47d4 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "pubnub": "~3.7.0", "request-progress": "~0.3.1", "progress-bar": "~0.1.1", - "progress": "~1.1.8" + "progress": "~1.1.8", + "user-home": "~1.1.0" } }