mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 00:23:03 +00:00
fix: use passed method instead of resetting it
This commit is contained in:
@@ -16,7 +16,7 @@ import {asyncPool} from '@krlwlfrt/async-pool';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {AddLogLevel} from '@openstapps/logger/lib/transformations/add-log-level';
|
||||
import {Colorize} from '@openstapps/logger/lib/transformations/colorize';
|
||||
import * as commander from 'commander';
|
||||
import {Command} from 'commander';
|
||||
import {readFileSync} from 'fs';
|
||||
import {join} from 'path';
|
||||
import {Api, ApiRequestOptions} from './api';
|
||||
@@ -30,6 +30,8 @@ Logger.setTransformations([
|
||||
const pkgJson = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'))
|
||||
.toString());
|
||||
|
||||
const commander = new Command('openstapps-gitlab-api');
|
||||
|
||||
commander
|
||||
.version(pkgJson.version);
|
||||
|
||||
@@ -77,6 +79,8 @@ commander
|
||||
// tslint:disable-next-line:no-magic-numbers
|
||||
await asyncPool(5, issues, async (issue) => {
|
||||
if (action === 'close') {
|
||||
Logger.info(`Closing issue #${issue.iid} of project '${projectId}': ${issue.title}.`);
|
||||
|
||||
await api.makeGitLabAPIRequest(`/projects/${projectId}/issues/${issue.iid}`, {
|
||||
data: {
|
||||
state_event: 'close',
|
||||
|
||||
Reference in New Issue
Block a user