country-code fixes
- fixes to country code TLD descriptions
This commit is contained in:
parent
10ddb1bbfe
commit
a5770123fb
|
@ -15,7 +15,7 @@ const stringify = require('csv-stringify');
|
|||
const parse = require('csv-parse');
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
const md5File = require('md5-file/promise');
|
||||
const md5File = require('md5-file');
|
||||
const pathinfo = require('pathinfo');
|
||||
const program = require('commander');
|
||||
const tmp = require('tmp');
|
||||
|
@ -103,7 +103,10 @@ if (!program.quiet) {
|
|||
});
|
||||
|
||||
console.log('done');
|
||||
//console.error('NOTICE: the following "countries" did not have an assigned top level domain: ' + missingTld.join(', '));
|
||||
|
||||
if (!program.quiet) {
|
||||
console.log(meName + ': NOTICE: the following "countries" did not have an assigned top level domain: ' + missingTld.join(', '));
|
||||
}
|
||||
|
||||
process.stdout.write("building description / TLD hashmap...");
|
||||
let tld2Desc = {};
|
||||
|
@ -133,8 +136,7 @@ if (!program.quiet) {
|
|||
|
||||
parser.write(fs.readFileSync(fileTldDescCsv));
|
||||
|
||||
parser.end();
|
||||
|
||||
parser.end(function() {
|
||||
console.log("done");
|
||||
|
||||
const tdPosMap = {
|
||||
|
@ -207,8 +209,8 @@ if (!program.quiet) {
|
|||
console.log('done');
|
||||
|
||||
if (fs.existsSync(fileTldsCsv)) {
|
||||
const newMd5 = await md5File(fileNewTldsCsv);
|
||||
const csvMd5 = await md5File(fileTldsCsv);
|
||||
const newMd5 = md5File.sync(fileNewTldsCsv);
|
||||
const csvMd5 = md5File.sync(fileTldsCsv);
|
||||
if (csvMd5 == newMd5) {
|
||||
console.error(meName + ": (NOTICE) ignoring newly generated 'tlds.csv' file that is identical to the existing file (md5: " + csvMd5 + ", path: " + fileTldsCsv + ")");
|
||||
return;
|
||||
|
@ -223,5 +225,6 @@ if (!program.quiet) {
|
|||
process.stdout.write("saving new 'tlds.csv'...");
|
||||
fs.copySync(fileNewTldsCsv, fileTldsCsv);
|
||||
console.log('done');
|
||||
});
|
||||
|
||||
})();
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue