Commit 3c4ede82 authored by Éloïs's avatar Éloïs

[mod] indexing : get list of existing indexing files

parent 54b34b72
const os = require('os');
const fs = require('fs')
module.exports = function timestampToDatetime(server, conf, program, params) {
// Get monitDatasPath
const mdb = program.mdb || "duniter_default";
const monitDatasPath = os.homedir() + "/.config/duniter/" + mdb + "/currency-monit/";
console.log('sync...');
console.log('monitDatasPath=%s', monitDatasPath);
console.log('ok');
console.log('indexing...');
console.log('monitDatasPath=%s', monitDatasPath);
try {
let files = fs.readdirSync(monitDatasPath);
// chunk_0-250.json
for (file of files)
{
console.log('%s', file);
}
} catch (err) {
if (err.code === 'ENOENT') {
console.log('directory "currency-monit" doesn\'t exist');
}
}
console.log('ok');
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment