Skip to content

Commit

Permalink
log transaction hash
Browse files Browse the repository at this point in the history
  • Loading branch information
aquiladev committed Mar 28, 2020
1 parent fea22e0 commit 7293377
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions updater/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,26 @@ module.exports = {
async update(options) {
validate(options);

const { name, contentHash, contentType } = options;
const { name, contentHash, contentType, verbose } = options;
const { factory } = tldMap.find(tld => name.endsWith(tld.name));
const updater = await factory(options);

let current;
try {
current = await updater.getContenthash();
if (current.hash === contentHash) {
console.log(`Content hash is up to date. [#${current.hash}]`);
console.log(`Content hash is up to date. [${current.hash}]`);
return;
}
} catch (error) {
core.warning(error);
}

return updater.setContenthash({ contentType, contentHash });
const result = await updater.setContenthash({ contentType, contentHash });
if (verbose) {
console.log(result);
}

return result;
}
}

0 comments on commit 7293377

Please sign in to comment.