You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2019/10/11 16:07:57 UTC
[GitHub] [camel-k] bfitzpat edited a comment on issue #1009: Provide a plain
text file with the latest version of Camel K for easier automation of
downloading via the tooling
bfitzpat edited a comment on issue #1009: Provide a plain text file with the latest version of Camel K for easier automation of downloading via the tooling
URL: https://github.com/apache/camel-k/issues/1009#issuecomment-541125957
That works. :)
```
async function getLatestCamelKVersion(): Promise<Errorable<string>> {
const latestURL = 'https://api.github.com/repos/apache/camel-k/releases/latest';
const downloadResult = await downloader.toTempFile(latestURL);
if (failed(downloadResult)) {
return { succeeded: false, error: [`Failed to establish kubectl stable version: ${downloadResult.error[0]}`] };
}
const rawtext = fs.readFileSync(downloadResult.result, 'utf-8');
let latestJSON = JSON.parse(rawtext);
let tagName = latestJSON.tag_name;
if (tagName) {
return { succeeded: true, result: tagName };
}
return { succeeded: false, error: [`Failed to retrieve latest Apache Camel K version tag from : ${latestURL}`] };
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services