2
0
mirror of https://github.com/cderche/greenlock-storage-s3 synced 2025-02-22 22:28:04 +00:00
gl-store-s3.js/lib/pathHelper.js

21 lines
547 B
JavaScript
Raw Normal View History

2019-05-09 00:01:23 +01:00
const path = require("path");
2019-05-08 15:37:55 +01:00
2019-05-09 00:12:15 +01:00
const tameWild = (wild) => {
2019-05-09 00:01:23 +01:00
return wild.replace(/\*/g, "_");
2019-05-09 08:36:47 +01:00
};
2019-05-08 15:37:55 +01:00
module.exports = {
certificatesPath: (options, id, fileName) => {
2019-05-09 00:01:23 +01:00
var filePath = path.join(options.configDir, "live", tameWild(id), fileName);
console.log("filePath:", filePath);
2019-05-08 15:37:55 +01:00
return filePath;
},
accountsPath: (options, id) => {
2019-05-09 00:01:23 +01:00
var filePath = path.join(options.configDir, options.accountsDir, tameWild(id) + ".json");
console.log("filePath:", filePath);
2019-05-08 15:37:55 +01:00
return filePath;
}
2019-05-09 00:01:23 +01:00
};