fix(core): update
This commit is contained in:
@@ -148,4 +148,26 @@ export class GitlabProject {
|
||||
const readmeFile = await this.getFileFromProject('readme.md', refArg);
|
||||
return readmeFile.contents.toString('utf8');
|
||||
}
|
||||
|
||||
public async getNpmKeywords(refArg: string = 'master'): Promise<string[]> {
|
||||
const packageJsonFile = await this.getFileFromProject('package.json', refArg);
|
||||
const packageJsonObject: any = JSON.parse(packageJsonFile.contents.toString('utf8'));
|
||||
return packageJsonObject.keywords ? packageJsonObject.keywords : [];
|
||||
}
|
||||
|
||||
public async getProjectAsArticle(): Promise<plugins.tsclass.content.IArticle> {
|
||||
return {
|
||||
url: this.data.web_url,
|
||||
author: null,
|
||||
content: await this.getReadmeAsMarkdown().catch(err => null),
|
||||
tags: await this.getNpmKeywords().catch(err => null),
|
||||
title: this.data.name,
|
||||
timestamp: new Date(this.data.last_activity_at).getTime(),
|
||||
featuredImageUrl: null
|
||||
}
|
||||
}
|
||||
|
||||
public async syncNpmTagsToGitlabTopics() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user