gl-store-s3.js/lib/pathHelper.js

21 lines
547 B
JavaScript
Raw Normal View History

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