diff --git a/README.md b/README.md index 38211ad..43e028f 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ For all actions, the tool will ask you to input a GitHub token. To obtain this t | -t, --token | The GitHub token. | | -o, --organization | The User or Organization slug that the repo lives under.
Example: For `/myOrg/my-repo`, this value would be **myOrg**. | | -r, --repository | The repository name (slug).
Example: For `/myOrg/my-repo`, this value would be **my-repo**. | +| --csvDelimiter | The CSV delimiter character (defaults to ',') | | -v, --verbose | Include additional logging information. | | -h, --help | See all the options and help. | diff --git a/import.js b/import.js index 9abe6fb..b0c12b2 100644 --- a/import.js +++ b/import.js @@ -14,6 +14,7 @@ const importFile = (octokit, file, values) => { { trim: true, bom: true, + delimiter: values.csvDelimiter, }, (err, csvRows) => { if (err) throw err; diff --git a/index.js b/index.js index 9fb398a..edf12bf 100644 --- a/index.js +++ b/index.js @@ -35,7 +35,10 @@ program ) .option("-c, --exportComments", "Include comments in the export.") .option("-e, --exportAll", "Include all data in the export.") - .option("-v, --verbose", "Include additional logging information.") + .option( + "--csvDelimiter [csvDelimiter]", + "CSV delimiter character (defaults to ',')" + ) .option("-v, --verbose", "Include additional logging information.") .action(function (file, options) { co(function* () { const retObject = {}; @@ -56,6 +59,7 @@ program } retObject.exportComments = options.exportComments || false; retObject.exportAll = options.exportAll || false; + retObject.csvDelimiter = options.csvDelimiter || ','; retObject.verbose = options.verbose || false; retObject.userOrOrganization = options.organization || ""; diff --git a/test/semicolonSeparator.csv b/test/semicolonSeparator.csv new file mode 100644 index 0000000..1fec8a4 --- /dev/null +++ b/test/semicolonSeparator.csv @@ -0,0 +1,3 @@ +title;body;labels +Test 1; This is the test1 desc; bug +Test 2; This is the test2 desc; question \ No newline at end of file