Skip to content

firestore2json stating errors in console. #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions firestore/firestore2json.js
Original file line number Diff line number Diff line change
@@ -40,10 +40,10 @@ var utils_1 = require("./utils");
var fs = require("fs");
var args = process.argv.slice(2);
var processDocument;
if (fs.existsSync("./".concat(args[0], "_processDocument.js"))) {
if (fs.existsSync("./".concat(args[0], ".js"))) {
// read file to string
processDocument = require("./".concat(args[0], "_processDocument.js"));
// processDocument = fs.readFileSync(`./${args[0]}_processDocument.js`, 'utf8');
processDocument = require("./".concat(args[0], ".js"));
// processDocument = fs.readFileSync(`./${args[0]}.js`, 'utf8');
}
var db;
var recordCounters = {};
@@ -141,6 +141,7 @@ function getBatch(collectionName, offset, batchSize, limit) {
data.push(doc);
});
})["catch"](function (err) {
console.error('error: ', err);
error = err;
})];
case 1:
1 change: 1 addition & 0 deletions firestore/firestore2json.ts
Original file line number Diff line number Diff line change
@@ -75,6 +75,7 @@ async function getBatch(collectionName: string, offset: number, batchSize: numbe
});
})
.catch(err => {
console.error('error: ', err);
error = err;
});
return {data, error};