mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
Proper version update (#5379)
Co-authored-by: Catenocrypt <catenocrypt@users.noreply.github.com>
This commit is contained in:
parent
c850c6f2e9
commit
6ba5809679
|
@ -93,7 +93,6 @@ export function writeToFile(filename: string, list: List): void {
|
||||||
// Write out to file, updating version+timestamp if there was change
|
// Write out to file, updating version+timestamp if there was change
|
||||||
export function writeToFileWithUpdate(filename: string, list: List): void {
|
export function writeToFileWithUpdate(filename: string, list: List): void {
|
||||||
let listOld: List = undefined;
|
let listOld: List = undefined;
|
||||||
let oldVersion: Version = new Version(0, 0, 0);
|
|
||||||
try {
|
try {
|
||||||
listOld = readJsonFile(filename) as List;
|
listOld = readJsonFile(filename) as List;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -103,18 +102,16 @@ export function writeToFileWithUpdate(filename: string, list: List): void {
|
||||||
if (listOld === undefined) {
|
if (listOld === undefined) {
|
||||||
changed = true;
|
changed = true;
|
||||||
} else {
|
} else {
|
||||||
oldVersion = listOld.version;
|
list.version = listOld.version; // take over
|
||||||
const diffs = diffTokenlist(list, listOld);
|
const diffs = diffTokenlist(list, listOld);
|
||||||
if (diffs != undefined) {
|
if (diffs != undefined) {
|
||||||
//console.log("List has Changed", JSON.stringify(diffs));
|
//console.log("List has Changed", JSON.stringify(diffs));
|
||||||
changed = true;
|
changed = true;
|
||||||
|
list.version = new Version(list.version.major + 1, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (changed) {
|
if (changed) {
|
||||||
// update version and time
|
// update timestqamp
|
||||||
list.version.major = oldVersion.major + 1;
|
|
||||||
list.version.minor = 0;
|
|
||||||
list.version.patch = 0;
|
|
||||||
list.timestamp = (new Date()).toISOString();
|
list.timestamp = (new Date()).toISOString();
|
||||||
console.log(`Version and timestamp updated, ${list.version.major}.${list.version.minor}.${list.version.patch} timestamp ${list.timestamp}`);
|
console.log(`Version and timestamp updated, ${list.version.major}.${list.version.minor}.${list.version.patch} timestamp ${list.timestamp}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user