warn and ignore on line mismatch
This commit is contained in:
parent
6e7e24be49
commit
10093659b4
7
index.js
7
index.js
|
@ -4,6 +4,7 @@ var fs = require('fs');
|
||||||
var sfs = require('safe-replace').create();
|
var sfs = require('safe-replace').create();
|
||||||
|
|
||||||
function snakeCase(key) {
|
function snakeCase(key) {
|
||||||
|
// TODO let user supply list of exceptions
|
||||||
if ('tlsSni01Port' === key) {
|
if ('tlsSni01Port' === key) {
|
||||||
return 'tls_sni_01_port';
|
return 'tls_sni_01_port';
|
||||||
}
|
}
|
||||||
|
@ -127,6 +128,12 @@ function stringifyPythonConf(obj, cb) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!obj.__lines[num] || !obj.__lines[num].indexOf) {
|
||||||
|
console.warn('[pyconf] WARN index past array length:');
|
||||||
|
console.log(obj.__lines.length, num, obj.__lines[num]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// restore comments
|
// restore comments
|
||||||
if (-1 !== obj.__lines[num].indexOf('#')) {
|
if (-1 !== obj.__lines[num].indexOf('#')) {
|
||||||
comment = obj.__lines[num].replace(/.*?(\s*#.*)/, '$1');
|
comment = obj.__lines[num].replace(/.*?(\s*#.*)/, '$1');
|
||||||
|
|
Loading…
Reference in New Issue