Skip to content

Commit

Permalink
new import/export command - refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
KarolNet committed Nov 28, 2024
1 parent 2374acf commit 3a9d63e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions commands/exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ async function exporter(directory, flotiqApiUrl, flotiqApiKey, skipContent, ctd)
}
return true;
}
async function main(argv) {

async function handler(argv) {

const dirStat = await fs.lstat(argv.directory);

Expand Down Expand Up @@ -171,6 +172,6 @@ module.exports = {
demandOption: false,
})
},
handler: main,
exporter: exporter
handler,
exporter
}
6 changes: 3 additions & 3 deletions commands/importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ async function importer(directory, flotiqApiUrl, flotiqApiKey, skipDefinitions,
}
}
}
async function main(argv) {
async function handler(argv) {
if (!argv.directory || !argv.flotiqApiKey) {
console.error(`Usage: ${__filename} <import_dir> <api_key>`)
return false;
Expand Down Expand Up @@ -493,6 +493,6 @@ module.exports = {
demandOption: false,
})
},
handler: main,
importer: importer
handler,
importer
}
3 changes: 3 additions & 0 deletions src/flotiq-api/flotiq-api.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* this api client is deprecated, please use src/flotiq-api
*/
const fetch = require("node-fetch");
const config = require("../configuration/config");
const FormData = require('form-data');
Expand Down

0 comments on commit 3a9d63e

Please sign in to comment.