Fix some missing function errors.

This commit is contained in:
Peter Kaske 2018-07-05 08:48:52 +02:00
parent 89fa3d688c
commit 7b4089ecb9
1 changed files with 6 additions and 5 deletions

View File

@ -20,6 +20,7 @@ var path = require('path');
var fs = require('fs'); var fs = require('fs');
var readFileAsync = util.promisify(fs.readFile); var readFileAsync = util.promisify(fs.readFile);
var readdirAsync = util.promisify(fs.readdir); var readdirAsync = util.promisify(fs.readdir);
var statAsync = util.promisify(fs.stat);
var sfs = require('safe-replace'); var sfs = require('safe-replace');
var os = require('os'); var os = require('os');
var symlink = require('fs-symlink'); var symlink = require('fs-symlink');
@ -193,7 +194,7 @@ module.exports.create = function (configs) {
key = keypair.privateKeyPem; key = keypair.privateKeyPem;
} }
return fs.writeFileAsync(keypath, key, 'ascii').then(function () { return sfs.writeFileAsync(keypath, key, 'ascii').then(function () {
return keypair; return keypair;
}); });
}); });
@ -230,7 +231,7 @@ module.exports.create = function (configs) {
, readFileAsync(args.chainPath, 'ascii') // 2 , readFileAsync(args.chainPath, 'ascii') // 2
// stat the file, not the link // stat the file, not the link
, fs.statAsync(args.certPath) // 3 , statAsync(args.certPath) // 3
]).then(function (arr) { ]).then(function (arr) {
return { return {
privkey: arr[0] // privkey.pem privkey: arr[0] // privkey.pem
@ -516,9 +517,9 @@ module.exports.create = function (configs) {
// TODO abstract file writing // TODO abstract file writing
return PromiseA.all([ return PromiseA.all([
// meta.json {"creation_host": "ns1.redirect-www.org", "creation_dt": "2015-12-11T04:14:38Z"} // meta.json {"creation_host": "ns1.redirect-www.org", "creation_dt": "2015-12-11T04:14:38Z"}
fs.writeFileAsync(path.join(accountDir, 'meta.json'), JSON.stringify(accountMeta), 'utf8') sfs.writeFileAsync(path.join(accountDir, 'meta.json'), JSON.stringify(accountMeta), 'utf8')
// private_key.json { "e", "d", "n", "q", "p", "kty", "qi", "dp", "dq" } // private_key.json { "e", "d", "n", "q", "p", "kty", "qi", "dp", "dq" }
, fs.writeFileAsync(path.join(accountDir, 'private_key.json'), JSON.stringify(reg.keypair.privateKeyJwk), 'utf8') , sfs.writeFileAsync(path.join(accountDir, 'private_key.json'), JSON.stringify(reg.keypair.privateKeyJwk), 'utf8')
// regr.json: // regr.json:
/* /*
{ body: { contact: [ 'mailto:coolaj86@gmail.com' ], { body: { contact: [ 'mailto:coolaj86@gmail.com' ],
@ -528,7 +529,7 @@ module.exports.create = function (configs) {
new_authzr_uri: 'https://acme-v01.api.letsencrypt.org/acme/new-authz', new_authzr_uri: 'https://acme-v01.api.letsencrypt.org/acme/new-authz',
terms_of_service: 'https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf' } terms_of_service: 'https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf' }
*/ */
, fs.writeFileAsync(path.join(accountDir, 'regr.json'), , sfs.writeFileAsync(path.join(accountDir, 'regr.json'),
JSON.stringify(regrBody), JSON.stringify(regrBody),
'utf8') 'utf8')
]); ]);