Родитель
51a27dca38
Коммит
de7d26422b
|
@ -632,6 +632,14 @@ export class GitHubRepository implements vscode.Disposable {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
async canGetProjectsNow(): Promise<boolean> {
|
||||
let { schema } = await this.ensure();
|
||||
if (schema.GetRepoProjects && schema.GetOrgProjects) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async getOrgProjects(): Promise<IProject[]> {
|
||||
Logger.debug(`Fetch org projects - enter`, GitHubRepository.ID);
|
||||
let { query, remote, schema } = await this.ensure();
|
||||
|
|
|
@ -250,15 +250,16 @@ export async function extractMetadataFromFile(repositoriesManager: RepositoriesM
|
|||
if (text.startsWith(PROJECTS)) {
|
||||
const lines = text.split(/\r\n|\n/, 1);
|
||||
if (lines.length === 1) {
|
||||
const repoProjects = await folderManager.getAllProjects(repo);
|
||||
projects = lines[0].substring(PROJECTS.length)
|
||||
.split(',')
|
||||
.map(value => {
|
||||
value = value.trim();
|
||||
return repoProjects.find(project => project.title === value);
|
||||
})
|
||||
.filter<IProject>((project): project is IProject => !!project);
|
||||
|
||||
if (await repo.canGetProjectsNow()) {
|
||||
const repoProjects = await folderManager.getAllProjects(repo);
|
||||
projects = lines[0].substring(PROJECTS.length)
|
||||
.split(',')
|
||||
.map(value => {
|
||||
value = value.trim();
|
||||
return repoProjects.find(project => project.title === value);
|
||||
})
|
||||
.filter<IProject>((project): project is IProject => !!project);
|
||||
}
|
||||
text = text.substring(lines[0].length).trim();
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче