You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
467 B
24 lines
467 B
3 years ago
|
'use strict';
|
||
|
|
||
|
var path = require('path')
|
||
|
, fs = require('fs')
|
||
|
, helper = require('./helper.js')
|
||
|
;
|
||
|
|
||
|
|
||
|
module.exports = function(connInfo, cb) {
|
||
|
var file = helper.getFileName();
|
||
|
|
||
|
fs.stat(file, function(err, stat){
|
||
|
if (err || !helper.usePgPass(stat, file)) {
|
||
|
return cb(undefined);
|
||
|
}
|
||
|
|
||
|
var st = fs.createReadStream(file);
|
||
|
|
||
|
helper.getPassword(connInfo, st, cb);
|
||
|
});
|
||
|
};
|
||
|
|
||
|
module.exports.warnTo = helper.warnTo;
|