MCPcopy Create free account
hub / github.com/TGX-Android/Publisher / getAppVersion

Function getAppVersion

main.js:524–544  ·  view source on GitHub ↗
(callback)

Source from the content-addressed store, hash-verified

522}
523
524function getAppVersion (callback) {
525 fs.readFile(settings.TGX_SOURCE_PATH + '/version.properties', 'utf-8', function (err, data) {
526 if (err) {
527 callback(null);
528 } else {
529 const buildVersion = parseInt(getProperty(data, 'version.app'));
530 const creationDate = parseInt(getProperty(data, 'version.creation'));
531 if (!creationDate) {
532 callback('#' + buildVersion);
533 return;
534 }
535 const majorVersion = getProperty(data, 'version.major');
536 getCommitDate((commitDate) => {
537 const buildDate = new Date(commitDate * 1000);
538 const fromDate = new Date(creationDate);
539 const minorVersion = monthYears(buildDate, fromDate);
540 callback({code: buildVersion, name: majorVersion + '.' + minorVersion + '.' + buildVersion});
541 });
542 }
543 });
544}
545
546function escapeMarkdown (text) {
547 if (!text)

Callers 1

processPrivateCommandFunction · 0.85

Calls 3

getPropertyFunction · 0.85
getCommitDateFunction · 0.85
monthYearsFunction · 0.85

Tested by

no test coverage detected