Compare commits

...

3 commits

3 changed files with 4 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View file

@ -8,7 +8,7 @@ import { Command } from 'cliffy'
await new Command()
.name('redmine-csv-loader')
.description('Create Redmine users from CSV and add users to a group.')
.version('0.1.0')
.version('0.1.1')
.option('-g, --group <group:string>', 'Name of the group to add users in.')
.option(
'-a, --only-add [only-add:boolean]',
@ -23,10 +23,10 @@ await new Command()
{ required: true },
)
.arguments('<csv:file>')
.action(async ({ group, endpoint, apiKey, onlyAdd }, domain) => {
.action(async ({ group, endpoint, apiKey, onlyAdd }, filePath) => {
const redmine = new Redmine({ endpoint, apiKey })
const file = await Deno.readTextFile(domain)
const file = await Deno.readTextFile(filePath)
const csv = CSV.parse(file.replaceAll(';', ','), {
skipFirstRow: true,
@ -34,7 +34,7 @@ await new Command()
if (!onlyAdd) createUsers(redmine, csv)
if (group) {
appendToGroup(redmine, csv, prompt('Enter a group name ?: ') ?? '')
appendToGroup(redmine, csv, group)
}
})
.parse()