2
0
mirror of https://github.com/cderche/greenlock-storage-s3 synced 2025-12-23 21:08:39 +00:00
gl-store-s3.js/pathHelper.js
2019-05-08 15:37:55 +01:00

21 lines
539 B
JavaScript

const path = require('path');
tameWild = (wild) => {
return wild.replace(/\*/g, '_');
}
module.exports = {
certificatesPath: (options, id, fileName) => {
var filePath = path.join(options.configDir, 'live', tameWild(id), fileName);
console.log('filePath:', filePath);
return filePath;
},
accountsPath: (options, id) => {
var filePath = path.join(options.configDir, options.accountsDir, tameWild(id) + '.json');
console.log('filePath:', filePath);
return filePath;
}
}