From e7c11ec6f54b5ace543904c9a1a152b33c727855 Mon Sep 17 00:00:00 2001 From: Corey Lammie Date: Sun, 25 Nov 2018 21:01:41 +1000 Subject: [PATCH] Fixed Import.JS CGI Path Logic --- lib/import.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/import.js b/lib/import.js index 93c7b7d..d828ee4 100644 --- a/lib/import.js +++ b/lib/import.js @@ -38,8 +38,11 @@ function importCollections(opts, callback) { if (!collection) { return cb('> Missing collection name in call to importOne method'); } + //console.log(collection); + collection = /[^/]*$/.exec(collection)[0]; return fsBackend.readFile(`${dataDir}/${collection}.json`, (readErr, readData) => { + //return fsBackend.readFile(`${collection}.json`, (readErr, readData) => { if (readErr) { return cb(readErr); } @@ -119,7 +122,6 @@ function main(opts, callback) { // 1. get collections const allCollections = fsBackend.scanDirSync(dataDir); - const resolved = resolveSelections( allCollections, collectionsToInclude, @@ -137,7 +139,6 @@ function main(opts, callback) { connection: connDb, dataDir }; - return importCollections(newOpts, callback); }); }