From 65ea5fbe2ab783f5102c972c9e157c362b2f3934 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 15 Dec 2015 13:21:26 +0000 Subject: [PATCH] one step closer --- backends/ursa.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backends/ursa.js b/backends/ursa.js index 2798dbd..b9f7276 100644 --- a/backends/ursa.js +++ b/backends/ursa.js @@ -77,6 +77,9 @@ function createAccount(args, handlers) { } , accountPrivateKeyPem: pems.privateKeyPem }).then(function (body) { + if (body instanceof Buffer) { + body = body.toString('utf8'); + } if ('string' === typeof body) { try { body = JSON.parse(body); @@ -85,9 +88,10 @@ function createAccount(args, handlers) { } } - return mkdirpAsync(args.accountDir, function () { + var accountDir = path.join(args.accountsDir, pems.publicKeyMd5); + + return mkdirpAsync(accountDir).then(function () { - var accountDir = path.join(args.accountsDir, pems.publicKeyMd5); var isoDate = new Date().toISOString(); var accountMeta = { creation_host: localname @@ -119,7 +123,6 @@ function createAccount(args, handlers) { } function getAccount(accountId, args, handlers) { - console.log(args.accountsDir, accountId); var accountDir = path.join(args.accountsDir, accountId); var files = {}; var configs = ['meta.json', 'private_key.json', 'regr.json'];