one step closer
This commit is contained in:
parent
3af1523a35
commit
65ea5fbe2a
|
@ -77,6 +77,9 @@ function createAccount(args, handlers) {
|
||||||
}
|
}
|
||||||
, accountPrivateKeyPem: pems.privateKeyPem
|
, accountPrivateKeyPem: pems.privateKeyPem
|
||||||
}).then(function (body) {
|
}).then(function (body) {
|
||||||
|
if (body instanceof Buffer) {
|
||||||
|
body = body.toString('utf8');
|
||||||
|
}
|
||||||
if ('string' === typeof body) {
|
if ('string' === typeof body) {
|
||||||
try {
|
try {
|
||||||
body = JSON.parse(body);
|
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);
|
var accountDir = path.join(args.accountsDir, pems.publicKeyMd5);
|
||||||
|
|
||||||
|
return mkdirpAsync(accountDir).then(function () {
|
||||||
|
|
||||||
var isoDate = new Date().toISOString();
|
var isoDate = new Date().toISOString();
|
||||||
var accountMeta = {
|
var accountMeta = {
|
||||||
creation_host: localname
|
creation_host: localname
|
||||||
|
@ -119,7 +123,6 @@ function createAccount(args, handlers) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAccount(accountId, args, handlers) {
|
function getAccount(accountId, args, handlers) {
|
||||||
console.log(args.accountsDir, accountId);
|
|
||||||
var accountDir = path.join(args.accountsDir, accountId);
|
var accountDir = path.join(args.accountsDir, accountId);
|
||||||
var files = {};
|
var files = {};
|
||||||
var configs = ['meta.json', 'private_key.json', 'regr.json'];
|
var configs = ['meta.json', 'private_key.json', 'regr.json'];
|
||||||
|
|
Loading…
Reference in New Issue