From 749905706f245bbcee38573e5d7d7749bcc42fb1 Mon Sep 17 00:00:00 2001 From: Alexander Leitner Date: Mon, 17 Jul 2017 16:13:51 -0400 Subject: [PATCH] Fix gui complaints and jshint complaints --- bin/storjshare-status.js | 1 + lib/utils.js | 5 ++++- package.json | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/storjshare-status.js b/bin/storjshare-status.js index 3253d40..7be17f9 100755 --- a/bin/storjshare-status.js +++ b/bin/storjshare-status.js @@ -95,6 +95,7 @@ function prepareJson(shares) { } utils.connectToDaemon(port, function(rpc, sock) { + /*jshint maxcomplexity:7 */ rpc.status(function(err, shares) { if (storjshare_status.json) { // Print out json formatted share statuses diff --git a/lib/utils.js b/lib/utils.js index c151216..2c9cce2 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -80,7 +80,10 @@ exports.validate = function(config) { exports.validateAllocation = function(conf, callback) { const self = this; - if (!conf.storageAllocation.match(/[0-9]+([Tt]|[Mm]|[Gg]|[Kk])?[Bb]/g)) { + if (conf.storageAllocation && + !conf.storageAllocation.toString().match( + /[0-9]+([Tt]|[Mm]|[Gg]|[Kk])?[Bb]/g + )) { return callback( new Error('Invalid storage size specified: '+ conf.storageAllocation) ); diff --git a/package.json b/package.json index cc7e66c..a8c5c9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "storjshare-daemon", - "version": "3.5.0", + "version": "3.5.1", "description": "daemon + process manager for sharing space on the storj network", "main": "index.js", "bin": {