mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 16:13:06 +00:00
refactor: build system
This commit is contained in:
@@ -33,7 +33,9 @@ import {
|
||||
Tag,
|
||||
TreeFile,
|
||||
} from './types.js';
|
||||
import got from "got";
|
||||
import got from 'got';
|
||||
|
||||
export * from './types.js'
|
||||
|
||||
/**
|
||||
* Sleep for a number of milliseconds
|
||||
@@ -300,9 +302,7 @@ export class Api {
|
||||
commitish,
|
||||
)}`;
|
||||
|
||||
return this.makeGitLabAPIRequest(
|
||||
`projects/${projectId}/repository/files/${fileIdentifier}`,
|
||||
);
|
||||
return this.makeGitLabAPIRequest(`projects/${projectId}/repository/files/${fileIdentifier}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -508,17 +508,18 @@ export class Api {
|
||||
retry: {
|
||||
limit: _options.tries,
|
||||
},
|
||||
}).on('response', response => {
|
||||
const xTotalPages = response.headers['x-total-pages'];
|
||||
|
||||
if (typeof xTotalPages === 'string') {
|
||||
totalPages = Number.parseInt(xTotalPages, 10);
|
||||
}
|
||||
}).json<unknown[]>();
|
||||
})
|
||||
.on('response', response => {
|
||||
const xTotalPages = response.headers['x-total-pages'];
|
||||
|
||||
if (typeof xTotalPages === 'string') {
|
||||
totalPages = Number.parseInt(xTotalPages, 10);
|
||||
}
|
||||
})
|
||||
.json<unknown[]>();
|
||||
|
||||
if (_options.method === 'DELETE') {
|
||||
return (void 0) as unknown as T;
|
||||
return void 0 as unknown as T;
|
||||
}
|
||||
|
||||
apiResult =
|
||||
@@ -583,9 +584,12 @@ export class Api {
|
||||
*/
|
||||
public async setMilestoneForIssue(issue: Issue, milestoneId: number): Promise<Issue> {
|
||||
if (milestoneId === null) {
|
||||
return this.makeGitLabAPIRequest<Issue>(`projects/${issue.project_id}/issues/${issue.iid}?milestone_id=`, {
|
||||
method: 'PUT',
|
||||
});
|
||||
return this.makeGitLabAPIRequest<Issue>(
|
||||
`projects/${issue.project_id}/issues/${issue.iid}?milestone_id=`,
|
||||
{
|
||||
method: 'PUT',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
return this.makeGitLabAPIRequest<Issue>(
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {AddLogLevel} from '@openstapps/logger/lib/transformations/add-log-level.js';
|
||||
import {Colorize} from '@openstapps/logger/lib/transformations/colorize.js';
|
||||
import {Logger, AddLogLevel, Colorize} from '@openstapps/logger';
|
||||
import {Command} from 'commander';
|
||||
import {readFileSync} from 'fs';
|
||||
import path from 'path';
|
||||
@@ -172,7 +170,7 @@ ${note.body}`,
|
||||
|
||||
commander.parse(process.argv);
|
||||
|
||||
const token = commander.getOptionValue('token')
|
||||
const token = commander.getOptionValue('token');
|
||||
if (typeof token !== 'string' || token.length === 0) {
|
||||
Logger.warn(
|
||||
'You probably want to supply a GitLab token either via option or environment variable (GITLAB_PRIVATE_TOKEN).',
|
||||
Reference in New Issue
Block a user