Fixed updates parsing

This commit is contained in:
Observer KRypt0n_ 2021-11-29 19:28:13 +02:00
parent c392437b5d
commit 77a7421361
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA

View file

@ -84,12 +84,12 @@ export default class Tools
public static async getGitTags (uri: string): Promise<GitTag[]> public static async getGitTags (uri: string): Promise<GitTag[]>
{ {
return new Promise((resolve, reject) => { return new Promise(resolve => {
let git = spawn('git', ['ls-remote', '--tags', uri]), let git = spawn('git', ['ls-remote', '--tags', uri]),
tags: GitTag[] = []; tags: GitTag[] = [];
git.stdout.on('data', (data: string) => { git.stdout.on('data', (data: string) => {
data.toString().split(/\r\n|\r|\n/).forEach(line => { data.toString().split(/\r\n|\r|\n/).forEach((line: string) => {
if (line != '') if (line != '')
{ {
let matches = /^([0-9a-f]+)\trefs\/tags\/(.*)/.exec (line); let matches = /^([0-9a-f]+)\trefs\/tags\/(.*)/.exec (line);
@ -103,8 +103,6 @@ export default class Tools
}); });
}); });
git.stderr.on('data', (data: string) => reject(data));
git.on('close', () => resolve(tags)); git.on('close', () => resolve(tags));
}); });
} }