Skip to content

Commit a61d128

Browse files
committed
Added Support for Custom Config Comments
1 parent 947f16b commit a61d128

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Modules/Utils/createCustomConfig.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ module.exports = function (name, configData, addonName) {
66
let addon_config = null;
77
const generateConfig = function (path, data, type, name) {
88
if (["yml", "yaml"].includes(type.toLowerCase())) {
9-
fs.writeFileSync(
10-
path,
11-
YAML.stringify(data, { indent: 2, prettyErrors: true })
12-
);
9+
data = (YAML.stringify(data, { indent: 2, prettyErrors: true })).replace(/("|')?~(\d+)?("|')?:\s("|')?.+("|')?/g, match => "# " + match.replace(/("|')?~(\d+)?("|')?:\s/g, '').replace(/("|')/g, ''))
10+
fs.writeFileSync(path, data);
1311
addon_config = data;
1412
} else if (["json"].includes(type.toLowerCase())) {
1513
fs.writeFileSync(path, JSON.stringify(data, null, 4));

0 commit comments

Comments
 (0)